开发者

Getting an event on monitor hotplug for windows

开发者 https://www.devze.com 2023-01-07 06:54 出处:网络
I\'d really like to listen for when a monitor gets hotplugged like when a laptop docs or has a external monitor plugged in.

I'd really like to listen for when a monitor gets hotplugged like when a laptop docs or has a external monitor plugged in.

I'm hoping I can do this in .net ma开发者_如何转开发ybe with some pinvoke.


As said here:

When adding a monitor on Windows 7 x64 I see registered messages "UxdDisplayChangeMessage" and "HotplugDetected". You can use RegisterWindowMessage to get the identifier for these messages and later just handle messages with this identifier.

0

精彩评论

暂无评论...
验证码 换一张
取 消