views:

39

answers:

1

Hello,

More or less everything is in teh title, I am looking for a way to get from a cocoa application, pid_t of the running dock.app

Thanks in advance for your help,

regard,

+2  A: 

If you are running Mac OS X 10.6, then you can give a try to the runningApplications method of NSWorkspace:

NSArray *appList = [[NSWorkspace sharedWorkspace] runningApplications];

It will return an array of NSRunningApplication. Look up for Dock.app and use the processIdentifier property.

You can also take a look at the AppList sample application.

Laurent Etiemble
+1, except that it'd be smarter to look for an `NSRunningApplication` with the `com.apple.dock` bundle identifier, rather than `Dock.app`
Dave DeLong