Getting an event on monitor hotplug for windows

前端 未结 1 1991
情话喂你
情话喂你 2020-12-19 23:02

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 maybe w

相关标签:
1条回答
  • 2020-12-19 23:14

    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 讨论(0)
提交回复
热议问题