How to Prevent the System from Transitioning to Sleep Mode

Submit New Article

October 27, 2008 2:00 AM PDT


Challenge

Implement the principles of Application Power Management for Mobility to prevent the system from transitioning to sleep mode. In Windows* operating systems, the system’s transition to sleep mode refers to switching off the system to a Stand By or a Hibernate mode. To conserve battery power, Windows operating systems switch off the system to a Stand By or a Hibernate mode when they don’t detect certain activities for a specific period of time. The activities that Windows operating systems don’t automatically detect are: disk activity, CPU activity and video display activity. The activities that Windows automatically detects are keyboard input, mouse input, server activity, and changing window focus.

Applications like video players and presentation managers display video for long periods of time without any user input, and this often results in the operating system switching off the system display during a video playback or a presentation. To deal with this situation, the options available for users are either to switch on the system display each time it switches off, or to delay the system transition to sleep mode by increasing the waiting period for display activity. Neither of these operations is optimal, since switching on the system display each time reduces the user experience, and delaying the system transition to sleep mode wastes battery power when the system is not in use for extended periods.

Solution

Design applications to inform the operating system when they are performing an activity that the operating system doesn’t detect, preventing the system from transitioning to sleep mode. This results in a better user experience as well as in better power management.

The relevant measures for an application to prevent the system from transitioning to sleep mode include the following:

  • Identify application activities that the operating system doesn’t detect.
  • Review the Microsoft Windows Power Management APIs and Messages section in the source identified below. This section outlines available Windows operating system APIs for preventing the system from transitioning to sleep mode.
  • Implement application logic to prevent the system from transitioning to sleep mode when the application is performing activities that the operating system doesn’t detect.

 

This item is part of a series of Knowledge Base items that discusses the concept of Application Power Management for Mobility; the other items in the series are as follows:

 

Source

Applications Power Management for Mobility