Re: Querying the front application
Re: Querying the front application
- Subject: Re: Querying the front application
- From: email@hidden
- Date: Sun, 9 Jul 2006 18:15:43 +1000
Is there a currently recommended way for a Cocoa app to register
for a notification or something when the front-most application
changes?
After that's done, how could one query what application is now the
front-most?
I have a need to write a simple faceless utility that only does
its thing when a particular application is in the foreground.
You could also use the Accessibility API. The documentation is
pretty scattered on it, but http://developer.apple.com/documentation/
Accessibility/Reference/AccessibilityLowlevel/index.html seems to be
the right place to start. It uses a pretty familiar notifcation-
observer model; you can register for application activated/
deactivated notifications, and other such things. Parameters
provided in the notifications presumably include the application in
question. I've not used it myself though, so I couldn't tell you any
more.
Wade Tregaskis
ICQ: 40056898
AIM, Yahoo & Skype: wadetregaskis
MSN: email@hidden
iChat & email: email@hidden
Jabber: email@hidden
Google Talk: email@hidden
http://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden