Sleep method

The Sleep method puts a computer into the specified sleep state and automatically wakes up the computer after the specified wake-up time.

Syntax

HRESULT Sleep(
  [in]  LONG WakeTimeInSeconds,
  [in]  LONG SleepState
);

Parameters

  • WakeTimeInSeconds [in]
    The amount of time, in seconds, that must pass before the Real Time Clock (RTC) wakes up the computer. This value must be in the range of 0 to 1,209,600 inclusive.

  • SleepState [in]
    The desired sleep state. This value must be in the range 1 (S1) to 4 (S4) inclusive.

Return value

Sleep returns a standard HRESULT value.

Remarks

The Sleep method requires wake-up times to be nonnegative. The maximum wake-up time is a 14-day period, which is equal to 1,209,600 seconds.

See also

Console

Console::EnableAutoWakeIfPossible

Console::SetSleepState

Console::SetSleepStateInfo

Console::SetSleepStateInfoEx

 

 

Send comments about this topic to Microsoft

Build date: 1/12/2012