Re: checking status of a background app in a Cocoa program
Re: checking status of a background app in a Cocoa program
- Subject: Re: checking status of a background app in a Cocoa program
- From: Matt Neuburg <email@hidden>
- Date: Mon, 24 Sep 2007 09:51:49 -0700
- Thread-topic: checking status of a background app in a Cocoa program
On Sun, 23 Sep 2007 23:58:53 -0600, Donald Hall <email@hidden> said:
>I want my main (Cocoa-based) application to track the status of a
>background application - i.e. to notice when the background
>application starts and stops. NSWorkspace won't work for background
>applications. I have a Carbon application that does the monitoring
>just fine (based on the ObserveProcessLife Carbon example). Can I
>integrate the functionality of this program into my Cocoa program?
>Basically, the Carbon app registers launch and terminate functions in
>main.c that are called at the right times. Can I just link to Carbon
>as well as Cocoa and do the same thing in my main function
You needn't do it in your main function, but basically, although I have
never heard of "the ObserveProcessLife Carbon example", the answer should be
yes. The example probably uses Carbon events, which you can certainly use in
your Cocoa app. What I do is to call InstallApplicationEventHandler in
applicationDidFinishLaunching. This lets you designate a callback function,
and sure enough, that callback function is called whenever the change I'm
"listening" for occurs. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf>
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden