您的位置:首页 > 其它

VC 判断系统是否进入睡眠模式

2015-07-07 22:20 337 查看
 

WM_POWERBROADCAST消息可以很据wParam参数来判定判断睡眠唤醒只需PBT_APMRESUMESUSPEND和PBT_APMSUSPEND事件

 LRESULT CALLBACK WindowProc(

  HWND hwnd,       // handle to window

  UINT uMsg,       // WM_POWER

  WPARAM wParam,   // power-management event

  LPARAM lParam    // function-specific data

);

WM_POWERBROADCAST消息,可以很据wParam参数来判定,判断睡眠唤醒只需PBT_APMRESUMESUSPEND和PBT_APMSUSPEND事件

Event Meaning

PBT_APMBATTERYLOW Battery power is low.

PBT_APMOEMEVENT OEM-defined event occurred.OEM定义的事件发生。

PBT_APMPOWERSTATUSCHANGE Power status has changed.

PBT_APMQUERYSUSPEND Request for permission to suspend.申请许可暂停。

PBT_APMQUERYSUSPENDFAILED Suspension request denied.

PBT_APMRESUMEAUTOMATIC Operation resuming automatically after event.

PBT_APMRESUMECRITICAL Operation resuming after critical suspension.

PBT_APMRESUMESUSPEND Operation resuming after suspension.

PBT_APMSUSPEND System is suspending operation.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: