Re: Detecting a new application launch?
Re: Detecting a new application launch?
- Subject: Re: Detecting a new application launch?
- From: Colin Cornaby <email@hidden>
- Date: Sat, 10 Jan 2004 19:12:21 -0800
We've investigated this option and the problem is it doesn't appear to
trigger until the application is done launching, unless there is
something I missed...
On Jan 10, 2004, at 7:09 PM, Chaz McGarvey wrote:
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
-----------------------
Colin Cornaby - Co-Founder, Carpe Stellarem. Duality and XGame Projects
Manager.
http://www.carpestellarem.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.