SetSystemPowerState (Compact 2013)
This function sets the system power state to the requested value.
DWORD SetSystemPowerState( LPCWSTR psState, DWORD StateFlags, DWORD Options );
[in] Names the desired system state to enter.
[in] Optional. If the psState parameter is NULL, it names the system power state using the POWER_STATE_XXX flags defined in the Pm.h header file.
The following table shows possible values.
Screen backlight is on.
Password protected power state.
User idle state.
[in] Uses the optional POWER_FORCE flag to indicate that the state transfer is urgent. The interpretation of this flag is platform-dependent.
Indicates that the system power state has been set successfully.
- Win32 error code
Indicates that the system power state was not set.
If the requested power state transition causes the system to be suspended, this function returns only after system operation resumes and related PBT_RESUME messages have been broadcast in the POWER_BROADCAST structure. Some platforms may restrict which system power states can be set by applications.
System power states define maximum device power levels for all power-manageable devices in the system. If a device is already at or below the maximum power level mandated by the new system power state, the device power state is not updated.
If a system call explicitly puts the device into an idle state, an appropriate wake source event must be implemented on the target device to activate the device when an application calls SetSystemPowerState(POWER_STATE_SUSPEND).