Microsoft KB Archive/920782

= You may have to return Windows XP to a low-power state manually after you use code to resume Windows from a low-power state =

Article ID: 920782

Article Last Modified on 12/13/2006

-

APPLIES TO


 * Microsoft Windows XP Home Edition
 * Microsoft Windows XP Professional
 * Microsoft Windows XP Starter Edition
 * Microsoft Windows XP Tablet PC Edition

-



SYMPTOMS
After you use code to resume Microsoft Windows XP from a low-power state programmatically, you may have to return Windows to a low-power state manually. For example, after a program causes Windows to resume from Suspend or Hibernate mode, you may have to provide mouse or keyboard activity before Windows can return to Suspend or Hibernate mode. This problem may occur when you use any of the following methods:
 * SetActivePwrScheme
 * WriteGlobalPwrPolicy
 * CallNtPowerInformation



CAUSE
This problem occurs because an application changes the system power policy when Windows is in the Automatic Resume power state. The timer that Windows uses to resume the previous power state is cleared and does not reset. Therefore, Windows remains active until user activity is detected. When user activity is detected, the regular power policy settings that you define in Control Panel are used.



RESOLUTION
To resolve this problem, do not use code to modify the active power policy when Windows is in the Automatic Resume power state.

Notes
 * We recommend that applications use the SetThreadExecutionState method instead of modifying the active power policy.
 * You can use the IsSystemResumeAutomatic method to determine the current Windows power state.

Keywords: kbtshoot kbinfo kbprb KB920782

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.