如何检测显示器电源状态 [英] How to detect monitor power state

查看:175
本文介绍了如何检测显示器电源状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写一个可检测显示器当前电源状态的应用程序,即电源已打开,电源已关闭或处于待机状态.我知道SC_MONITORPOWER消息,您可以观察该消息以确定计算机何时指示显示器进入/离开待机模式.但这无法检测到用户何时关闭或打开显示器电源.能做到吗?假设可以做到,那么当监视器更改电源状态时是否有办法接收事件,以便避免轮询?

谢谢.

I want to write an app that detects the current power state of the monitor, i.e. powered on, powered off, or in standby.  I am aware of the SC_MONITORPOWER message, and you can watch for this message to determine when the computer is instructing the monitor to enter/leave standby mode.  But this does not detect when the monitor is powered off or on by the user.  Can this be done?  Assuming it can be done, is there a way to receive an event when the monitor changes power states so that I can avoid polling?

Thanks.

推荐答案

签出
http://www.codeguru.com/forum/archive/index.php/t-164460.html

http://pinvoke.net/default.aspx/user32.GetMonitorInfo

http://msdn.microsoft.com/zh-cn/library/ms534599(VS.85).aspx


Check out
http://www.codeguru.com/forum/archive/index.php/t-164460.html

http://pinvoke.net/default.aspx/user32.GetMonitorInfo

http://msdn.microsoft.com/en-us/library/ms534599(VS.85).aspx



这篇关于如何检测显示器电源状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆