简体   繁体   English

如何在win32应用程序中检测显示器的热插拔?

[英]How to detect hot plugging of monitor in a win32 application?

I need some kind of event from Windows whenever there is a monitor that's getting plugged into system. 只要有一台显示器插入系统,我就需要从Windows获得某种事件。 Is there any API in Windows to do that. Windows中是否有任何API可以做到这一点。 BTW, it is an C++ application 顺便说一下,它是一个C ++应用程序

使用RegisterDeviceNotification注册获取WM_DEVICECHANGE通知。

You can do it via WMI, AFAIK. 你可以通过WMI,AFAIK来做到这一点。 I've never tried it though so I can't give much help 我从未尝试过,所以我无法提供太多帮助

Read here for more info: MSDN - Receiving a WMI Event 有关详细信息,请阅读此处:MSDN - 接收WMI事件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM