iA piece of internet history. AllAPI.net was made by two Belgian teenagers from 1998 to 2002, and at its peak 180,000 programmers a month came here. We keep it online exactly as it was. Nothing here is maintained anymore.
AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 


SetSystemPowerState

The SetSystemPowerState function suspends the system by shutting power down. Depending on the ForceFlag parameter, the function either suspends operation immediately or requests permission from all applications and device drivers before doing so.
The calling process must have the SE_SHUTDOWN_NAME privilege. To enable the SE_SHUTDOWN_NAME privilege, use the AdjustTokenPrivileges function. For more information, see Privileges.

VB4-32,5,6
Declare Function SetSystemPowerState Lib "kernel32" (ByVal fSuspend As Long, ByVal fForce As Long) As Long

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

Library
Kernel32

Parameter Information
· fSuspend
Windows NT/2000: [in] Specifies the state of the system. If TRUE, the system is suspended. If FALSE, the system hibernates.
Windows 95/98: Ignored.

· fForce
[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.

Return Values
If power has been suspended and subsequently restored, the return value is nonzero.

If the system was not suspended, the return value is zero. To get extended error information, call GetLastError.

Examples

Related Functions

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
This site is located at http://allapi.mentalis.org/