FROM : wadeslists
DATE : Sun Jul 09 10:15:43 2006
>> 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_removed>
iChat & email: <email_removed>
Jabber: <email_removed>
Google Talk: <email_removed>
http://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
DATE : Sun Jul 09 10:15:43 2006
>> 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_removed>
iChat & email: <email_removed>
Jabber: <email_removed>
Google Talk: <email_removed>
http://homepage.mac.com/wadetregaskis/
-- Sed quis custodiet ipsos custodes?
| Related mails | Author | Date |
|---|---|---|
| Alexander Powell | Jul 9, 09:58 | |
| Rosyna | Jul 9, 10:05 | |
| Alexander Powell | Jul 9, 10:13 | |
| wadeslists | Jul 9, 10:15 | |
| Rosyna | Jul 9, 10:20 | |
| Uli Kusterer | Jul 9, 17:01 |






Cocoa mail archive

