Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.41 KB

File metadata and controls

53 lines (34 loc) · 1.41 KB

Home

Function name : SetSystemPowerState

Group: Power Management - Library: kernel32


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.


Declaration:

BOOL SetSystemPowerState(
  BOOL fSuspend,
  BOOL fForce
);
  

FoxPro declaration:

DECLARE INTEGER SetSystemPowerState IN kernel32;
	INTEGER fSuspend,;
	INTEGER fForce

  

Parameters:

fSuspend [in] If this parameter is TRUE, the system is suspended. If the parameter is FALSE, the system hibernates.

fForce [in] If this parameter is TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If the parameter is FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.


Return value:

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


Comments:

The first parameter is ignored in Windows Me/98/95.
This function is similar to the SetSuspendState function.