You are probably looking for SetSystemPowerState, which is part of Power Management Functions in Platform SDKsee details at
http://msdn.microsoft.com/library/en-us/hardware/power_2c4z.asp?frame=true
http://msdn.microsoft.com/library/en-us/hardware/power_2c4z.asp?frame=true
解决方案 »
- 如何在MFC中的单文档框架里的VIEW类里创建一个标签控件
- 请教删除多维数组中的1列这样做存在内存泄漏否?
- Soket通讯问题,两次Socket消息内容连在了一起了怎么办
- VC中在哪定义结构体
- 如何用 TextOut 或者 DrawText 输出垂直90 的文字?用 '@宋体'字体可以不?
- 多重继承的问题
- 真的很急,如何将一个HICON转化为CBitmap 对象?
- 字体的高度height和字号之间如何转换?
- 如何用moden进行点对点传输
- _beginthreadex函数卡住,不返回是什么原因
- 我是VC++自学者也是初学者,问个简单的问题,谢谢众位朋友了!
- 如何将CString内的数据转为double型?
Platform SDK: Hardware
SetSuspendState
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.BOOL SetSuspendState (
BOOL Hibernate,
BOOL ForceCritical,
BOOL DisableWakeEvent
);
Parameters
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.Res
An application may use SetSuspendState to transition the system from the working state to the standby (sleep), or optionally, hibernate (S4) state. This function is similar to the SetSystemPowerState function.Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Powrprof.h.
Library: Use Powrprof.lib.See Also
Power Management Overview, Power Management Functions, PBT_APMQUERYSUSPEND, PBT_APMSUSPEND Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International) Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Powrprof.h.
Library: Use Powrprof.lib.
See Also
Power Management Overview, Power Management Functions, PBT_APMQUERYSUSPEND, PBT_APMSUSPEND