How to detect hot plugging of monitor in a win32 application?
Asked Answered
L

2

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

Lentic answered 17/9, 2009 at 17:41 Comment(0)
E
9

Use RegisterDeviceNotification to register for getting WM_DEVICECHANGE notification.

Effluent answered 17/9, 2009 at 17:45 Comment(2)
It depends on how "turn off" function is implemented in the monitor and in the its driver.Effluent
Just turn off the monitor and check whether it is disappeared in the Device Manager.Effluent
N
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

Novah answered 17/9, 2009 at 17:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.