Re: Responding To Screen Saver/Sleep Events
Re: Responding To Screen Saver/Sleep Events
- Subject: Re: Responding To Screen Saver/Sleep Events
- From: Uli Kusterer <email@hidden>
- Date: Wed, 23 Jan 2008 18:14:31 +0100
On 23.01.2008, at 16:13, Chris Schmitt wrote:
I would like my application to do something if the screen savor has
started or the computer is going to sleep. Does anyone know where I
can find an example, information on how to do this, or maybe just
the API I need to look at?
I don't know of any Cocoa APIs to do this directly, but there are
some low-level APIs (I think they're vaguely related to IOKit, or
maybe it was the old power manager) to notify you when the Mac's put
to sleep. You don't have much time to do something before sleep, though.
To detect the screensaver, you could simply use Unix APIs to get the
list of running processes, and look for an app called
"ScreenSaverEngine". If that's there, the screen saver is running.
Cheers,
-- M. Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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