• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: App Listener?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: App Listener?


  • Subject: Re: App Listener?
  • From: James Montgomerie <email@hidden>
  • Date: Thu, 8 Jan 2009 15:09:54 +0000

On 8 Jan 2009, at 14:14, Rainer Brockerhoff wrote:
Today, the only solution seems to be to install a Carbon Event handler for the {kEventClassApplication, kEventAppFrontSwitched} event.

Even if such a NSWorkspace notification were to appear in a future version of Mac OS X, I'd be interested in a lower-level solution. I have a background process that can't link to AppKit due to security restrictions, and Carbon Events have gone away for 64-bit processes.

I did look at how HIToolbox does its magic, but it appears to be listening to a private notification from the Process Manager. And BSD, of course, has no concept of "front process". If nobody knows another public API for an app activation notification, I'll file an enhancement request.

If you don't mind asking your users to switch on accessibility access ("enable access for assistive devices" in the Universal Access preferences), you can use the Accessibility APIs to monitor app switching (this is what's used in the iChatStatusFromApplication sample code, for example - http://developer.apple.com/samplecode/iChatStatusFromApplication/) .


I say this informationally - I don't think it's a great solution either.

Jamie.
_______________________________________________

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


  • Follow-Ups:
    • Re: App Listener?
      • From: Rainer Brockerhoff <email@hidden>
References: 
 >Re: App Listener? (From: Rainer Brockerhoff <email@hidden>)

  • Prev by Date: Re: Removing CALayer after Animation
  • Next by Date: Re: -[NSView window] returns nil if its NSTabView not selected
  • Previous by thread: Re: App Listener?
  • Next by thread: Re: App Listener?
  • Index(es):
    • Date
    • Thread