A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



SetSuspendedState

The SetSuspendState function suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4). If the ForceFlag parameter is TRUE, the system suspends operation immediately; if it is FALSE, the system requests permission from all applications and device drivers before doing so.

VB4-32,5,6
Declare Function SetSuspendState Lib "Powrprof" (ByVal Hibernate As Long, ByVal ForceCritical As Long, ByVal DisableWakeEvent As Long) As Long

Operating Systems Supported
Requires Windows 2000 or later; Requires Windows 98 or later

Library
Powrprof

Parameter Information
- Hibernate
[in] Specifies the state of the system. If TRUE, the system hibernates. If FALSE, the system is suspended.

- ForceCritical
[in] Forced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.

- DisableWakeEvent
[in] If TRUE, the system disables all wake events. If FALSE, any system wake events remain enabled.

Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Last update: 07 April 2006