How to get pid_t of working dock.app in max os X

More or less everything in the header, I am looking for a way to get dock.app running cocoa pid_t from an application.

Thanks in advance for your help.

+4
source share
1 answer

If you are using Mac OS X 10.6, you can try the runningApplications NSWorkspace method:

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

It will return an NSRunningApplication array. Find Dock.app and use the processIdentifier property.

You can also see an example AppList application.

+5
source

Source: https://habr.com/ru/post/1314013/


All Articles