Important: The information in this document is obsolete and should not be used for new development.
AutoSleepControl
You can use theAutoSleepControl
function to turn the automatic sleep feature on and off.
void AutoSleepControl(Boolean enableSleep);
enableSleep
- A Boolean that specifies whether to enable the automatic sleep feature. Set this parameter to
true
to enable automatic sleep.DESCRIPTION
TheAutoSleepControl
function enables or disables the automatic sleep feature that causes the computer to go into sleep mode after a preset period of time. WhenenableSleep
is set totrue
, the automatic sleep feature is enabled (this is the normal state). WhenenableSleep
is set tofalse
, the computer will not go into the sleep mode unless it is forced to either by some user action--for example, by the user's selecting Sleep from the Special menu of the Finder--or in a low battery situation.SPECIAL CONSIDERATIONS
CallingAutoSleepControl
withenableSleep
set tofalse
multiple times increments the auto sleep disable level so that it requires the same number of calls toAutoSleepControl
withenableSleep
set totrue
to reenable the auto sleep feature. If more than one piece of software makes this call, auto sleep may not be reenabled when you think it should be.ASSEMBLY-LANGUAGE INFORMATION
The trap is_PowerMgrDispatch
($A09E). The selector value forAutoSleepControl
is 13 ($0D) in the low word of register D0. The Boolean value is passed in the high word of register D0.