SetSystemPowerState
Private Declare Function SetSystemPowerState Lib "kernel32" _
(ByVal fSuspend As Long, ByVal fForce As Long) As Long
Цитата:
Originally posted by ВуД
Подробно Про финкцию
Подробно Про финкцию
В MSDN
Цитата:
Originally posted by ВуД
Подробно Про финкцию для чего и т.д:
Private Declare Function SetSystemPowerState Lib "kernel32" _
(ByVal fSuspend As Long, ByVal fForce As Long) As Long
Подробно Про финкцию для чего и т.д:
Private Declare Function SetSystemPowerState Lib "kernel32" _
(ByVal fSuspend As Long, ByVal fForce As Long) As Long
Вот цитата из MSDN. Переводить будешь сам.
Цитата:
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 [COLOR=blue]SE_SHUTDOWN_NAME[/COLOR] privilege. To enable the [COLOR=blue]SE_SHUTDOWN_NAME[/COLOR] privilege, use the AdjustTokenPrivileges function
BOOL SetSystemPowerState(BOOL fSuspend, BOOL fForce);
Parameters
fSuspend
Windows NT/2000/XP: [in] Specifies the state of the system. If TRUE, the system is suspended. If FALSE, the system hibernates.
Windows 95/98/Me: 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.
Remarks
If any application or driver denies permission to suspend operation, the function broadcasts a PBT_APMQUERYSUSPENDFAILED event to each application and driver. If power is suspended, this function returns only after system operation is resumes and related WM_POWERBROADCAST messages have been broadcast to all applications and drivers.
This function is similar to the SetSuspendState function.
The calling process must have the [COLOR=blue]SE_SHUTDOWN_NAME[/COLOR] privilege. To enable the [COLOR=blue]SE_SHUTDOWN_NAME[/COLOR] privilege, use the AdjustTokenPrivileges function
BOOL SetSystemPowerState(BOOL fSuspend, BOOL fForce);
Parameters
fSuspend
Windows NT/2000/XP: [in] Specifies the state of the system. If TRUE, the system is suspended. If FALSE, the system hibernates.
Windows 95/98/Me: 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.
Remarks
If any application or driver denies permission to suspend operation, the function broadcasts a PBT_APMQUERYSUSPENDFAILED event to each application and driver. If power is suspended, this function returns only after system operation is resumes and related WM_POWERBROADCAST messages have been broadcast to all applications and drivers.
This function is similar to the SetSuspendState function.
Короче, спать ложит комп