Re: Detecting a new application launch?
Re: Detecting a new application launch?
- Subject: Re: Detecting a new application launch?
- From: Chaz McGarvey <email@hidden>
- Date: Sat, 10 Jan 2004 20:09:40 -0700
Hey:
On Jan 10, 2004, at 4:24 PM, Colin Cornaby wrote:
I was wondering if there was any sort of notification when a new
application launches. I am interested in keeping track of application
launches in my program and examining the process (so I need the
process id of the launched application) prior to it completing launch.
Check out NSWorkspace. There is a notification called
NSWorkspaceDidLaunchApplicationNotification. With the notification
comes a dictionary which can be used to look up things about the
application which launched. The @"NSApplicationName" and
@"NSApplicationProcessIdentifier" and should be of interest to you
(read the docs for more info).
One "gotcha." This will only work for applications with a graphical
interface. For example, processes which run in the terminal aren't
dealt with by NSWorkspace. Other than that observation, I'm not sure
what specific qualities define whether a process qualifies to be picked
up by NSWorkspace.
Chaz McGarvey
http://www.brokenzipper.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.