How to handle power off button on a notebook

I want to handle power off button pressing on my notebook with Windows 7. I've configured power management options to do nothing on this event, so it will not turn off immediately, but i want to catch the moment when user presses power button. How it can be done in C++?


I think there should be some WMI (Windows Management Instrumentation) events for this. Hope this helps: http://msdn.microsoft.com/en-us/library/aa394101%28v=VS.85%29.aspx

This is not specific to notebooks, nor is it specific to the power button alone. This applies to any means used to shutdown the machine.

链接地址: http://www.djcxy.com/p/47480.html

上一篇: 以编程方式在Windows中打开/关闭接入点?

下一篇: 如何处理笔记本电脑上的关闭电源按钮