[futurebasic] Re: [FB] Energy Saver Status

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2005 : Group Archive : Group : All Groups

From: Robert Purves <robert.purves@...>
Date: Tue, 15 Mar 2005 00:40:11 +1300
Ben Jamin wrote:

> Here is the apple technote for that subject:
> <http://developer.apple.com/technotes/tn2002/tn2075.html>
> Which links to this SDK:
> <ftp://ftp.apple.com/developer/Development_Kits/ 
> PM_DDK_1.0_Mac_OS_X.dmg.bin>
>
> On Friday, 11 March 2005 1:36 AM, Adam Bell <abell@...>  
> wrote:
>> How can I get the current status of the Energy Saver, i.e., whether  
>> the screen is sleeping or awake? Obviously the display card knows,  
>> but I can't find anything "soft" to tell me. Alternatively, how can I  
>> tell whether the desktop is visible or not? Grabbing the keyboard or  
>> mouse event that awakened the screen is very unreliable - the OS is  
>> listening for it.

The SDK mentioned does not contain any method for detecting when the  
display has been blanked out by Energy Saver. Perhaps if you explain  
why you want this information, someone will think of a different way to  
solve your problem.

The SDK does have an example (RegisterforSleep) showing how to detect  
when the system is about to go to sleep and when the system awakes  
after sleep, and how an application can prevent Energy Saver sleep. I  
translated this example into FB; if anyone wants the code, ask me  
privately.  OS X only.

Robert P.