Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting user switch notifications with a CFRunLoop




On Mar 15, 2008, at 11:06 AM, Rick Mann wrote:


On Mar 14, 2008, at 9:18 PM, Eric Schlegel wrote:
It might be easier to simply run a barebones Carbon or Cocoa event loop in your little app (both are built on top of CFRunLoop) and then use the Carbon or Cocoa notifications.


Right now my little app is a command-line tool. Does it need to be a bundle with an Info.plist to have a Carbon event loop?

No, it doesn't. However, I remembered that there's also a notification posted at the CoreGraphics level (which I think is what Carbon and Cocoa listen for) that you could check using just a CFRunLoop-based app. See CGSession.h and kCGNotifyGUIConsoleSessionChanged. You can use CFNotificationCenterGetDarwinNotifyCenter to get a notification center object to which you can add an observer for the ConsoleSessionChanged notification.


-eric

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >Getting user switch notifications with a CFRunLoop (From: Rick Mann <email@hidden>)
 >Re: Getting user switch notifications with a CFRunLoop (From: Eric Schlegel <email@hidden>)
 >Re: Getting user switch notifications with a CFRunLoop (From: Rick Mann <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.