Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The following information applies to wakes from sleep (S3) and hibernate (S4). For wakes from Modern Standby (S0 Low Power Idle), please refer to transitioning between idle and active states.
Your application can restore a computer that is in a sleep state to the working state by using a scheduled timer or a device event. This is known as a wake-up event. Use a waitable timer object to specify the time at which the system should wake. To create the object, use the CreateWaitableTimer function. To set the timer, use the SetWaitableTimer function. The pDueTime parameter specifies when the timer will be signaled. To specify that the system should wake when the timer is signaled, set the fResume parameter to TRUE.
When the system wakes automatically because of an event (other than power switch or user activity), the system automatically sets an unattended idle timer to at least 2 minutes. This timer gives applications sufficient time to call the SetThreadExecutionState function to indicate that they are busy. This time enables the system to return to the sleep state quickly after the computer is no longer required. The following criteria determine whether the system returns to the sleep state:
When the system wakes automatically, it broadcasts the PBT_APMRESUMEAUTOMATIC event to all applications. Because the user is not present, most applications should do nothing. Event-handling applications, such as fax servers, should handle their events. To determine whether the system is in this state, call the IsSystemResumeAutomatic function. When the system wakes automatically, the display is not automatically turned on.
If the system wakes due to user activity, the system will first broadcast the PBT_APMRESUMEAUTOMATIC event followed by a PBT_APMRESUMESUSPEND event. In addition, the system will turn on the display. Your application should reopen files that it closed when the system entered sleep and prepare for user input.
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today