• 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: Responding To Screen Saver/Sleep Events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Responding To Screen Saver/Sleep Events (From: Chris Schmitt <email@hidden>)

  • Prev by Date: Re: Get font name and size chosen
  • Next by Date: Re: Get font name and size chosen
  • Previous by thread: Responding To Screen Saver/Sleep Events
  • Next by thread: Re: Responding To Screen Saver/Sleep Events
  • Index(es):
    • Date
    • Thread