Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: How do I find out if a process is running if I have the process Name?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I find out if a process is running if I have the process Name?



Beware! This technique might not be suitable for production code. See http://developer.apple.com/qa/qa2004/qa1361.html

IMPORTANT: Because the definition of the kinfo_proc structure (in <sys/sysctl.h>) is conditionalized by __APPLE_API_UNSTABLE, you should restrict use of the above code to the debug build of your program.

I have a radar filed requesting clarification on QA1123 regarding this, but no word yet.


Christopher Hickman wrote:
http://developer.apple.com/qa/qa2001/qa1123.html

I know that somebody wrote a Cocoa wrapper for this, but a quick search
didn't find it.  I'm sure there's more in the archives if you dig.

Oh, and if you only care about GUI processes, then it's easy: -[NSWorkspace
launchedApplications] gives you a list of all launched apps.

-----Original Message-----
From: cocoa-dev-bounces+tophu=email@hidden [mailto:cocoa-dev-bounces+tophu=email@hidden] On Behalf Of Scott Mitchell
Sent: Thursday, May 18, 2006 11:52 AM
To: Cocoa-Dev List
Subject: How do I find out if a process is running if I have the process Name?


Hi,
This is not necessarily a Cocoa question, but this is for a Cocoa App. I have done a search for this, and have tried to figure this. But what I need to do is, given a process name (Application or other type), how can I find out if that process is running. Because if it is running already I need to do something different. I know this sounds weird, but if I was to explain the whole story behind this, it would take way to long. I thought this would be pretty easy to figure out, but I have not found anything yet.



Thanks, Scott Mitchell Senior Macintosh Software Engineer Excelsior Software http://www.excelsiorsoftware.com


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >RE: How do I find out if a process is running if I have the process Name? (From: "Christopher Hickman" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.