SetSystemPowerState (Windows CE 5.0)
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. If this parameter is not NULL then the StateFlags parameter is ignored.
- [in] Optional. If the psState parameter is NULL then names the system power state using the POWER_STATE_XXX flags defined in Pm.h.
The following table shows the various Power_State_XXX flags.
Flag Description POWER_STATE_ON On state POWER_STATE_OFF Off state POWER_STATE_CRITICAL Critical state POWER_STATE_BOOT Boot state POWER_STATE_IDLE Idle state POWER_STATE_SUSPEND Suspend state POWER_STATE_RESET Reset state
- [in] Uses the optional POWER_FORCE flag to indicate that the state transfer is urgent. The interpretation of this flag is platform dependent.
- System power state has been set successfully.
- Win32 error code
- System power state was not set.
If the requested power state transition causes the system to suspend, 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 will not be updated.
If a system call explicitly puts the device into an idle state, to activate the device when an application calls SetSystemPowerState(POWER_STATE_SUSPEND), an appropriate wake source event must be implemented on the target device. For more information, see Power Management Wake Sources.
Windows Mobile Remarks
The POWER_STATE_IDLE flag for the StateFlags parameter is set to Screen off for Windows Mobile-based devices. In additon, the StateFlags parameter can also be set to the POWER_STATE_USERIDLE state for Windows Mobile-based devices
The Options parameter can be set to POWER_DUMPDW to generate a Watson error report.
OS Versions: Windows CE .NET 4.0 and later.
Link Library: Coredll.lib.
Send Feedback on this topic to the authors