6

I need some kind of event from Windows whenever there is a monitor that's getting plugged into system. Is there any API in Windows to do that. BTW, it is an C++ application

Kirill V. Lyadvinsky
  • 97,037
  • 24
  • 136
  • 212
srs
  • 516
  • 1
  • 4
  • 20

2 Answers2

9

Use RegisterDeviceNotification to register for getting WM_DEVICECHANGE notification.

Kirill V. Lyadvinsky
  • 97,037
  • 24
  • 136
  • 212
1

You can do it via 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

GSP
  • 574
  • 3
  • 7
  • 34
Goz
  • 61,365
  • 24
  • 124
  • 204