Curtail Background Activities When Running On Batteries
[This is preliminary documentation and subject to change.]
Best Practice (Designed for Microsoft® Windows® Logo)
Your application should reduce background activities such as background pagination, background recalculation, autosaves and autoformatting when the computer is running on batteries because the hard disk and CPU are the highest power consumers an application affects.
While running on batteries, the following should be done to reduce hard disk and CPU usage:
-
Performing non-essential disk activity at regular intervals can cause the hard disk to spin up and down frequently, and, thus, use significantly more power than leaving the disk fully running. Therefore, applications should delay all nonessential disk activity until essential disk activity is required (for example, in response to an explicit user command). This allows the hard disk to remain off as much as possible. An application can detect whether the hard disk is already running by calling GetDevicePowerState before accessing the disk.
-
Applications should not perform operations at idle time unless the operations are in response to an explicit user command. This allows the operating system to stop the processor temporarily between time slices.
Applications can determine when the computer is running on batteries by calling GetSystemPowerStatus and by checking for the PBT_APMPOWERSTATUSCHANGE value returned by the WM_POWERBROADCAST message.
See Also
For more information about the OnNow initiative and for OnNow technical specifications, see http://www.microsoft.com/hwdev/onnow.htm.