• 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: listening for changes to active application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: listening for changes to active application


  • Subject: Re: listening for changes to active application
  • From: Jason Coco <email@hidden>
  • Date: Tue, 14 Oct 2008 12:08:31 -0400


On Oct 14, 2008, at 11:58 , Robert Nikander wrote:

Hi,

How can I be notified when the foreground application changes? I found "activeApplication" in NSWorkspace. Is there a way to observe changes to that property? I tried the following, which doesn't seem to work...

[[NSWorkspace sharedWorkspace] addObserver:obs forKeyPath:@"activeApplication" options: 0 context:NULL];
// where obs implements...
- (void)observeValueForKeyPath:ofObject:change:context:

You have to use the Carbon event manager to do this... there's no way to do it in Cocoa...

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >listening for changes to active application (From: Robert Nikander <email@hidden>)

  • Prev by Date: Re: Not so long filenames
  • Next by Date: Re: intercepting NSBrowser multiple selection extension with shift down/up arrow
  • Previous by thread: listening for changes to active application
  • Next by thread: Not so long filenames
  • Index(es):
    • Date
    • Thread