2

Does windows provide any api calls to detect if a monitor is presently connected on the VGA port by using DDC I or DCC 2?

I am trying to figure out a way to know if a monitor is connected and turned on.

Myforwik
  • 3,438
  • 5
  • 35
  • 42
  • I gotta admit, I've never heard of DDC or DCC. A google search for DDC reveals an application named something like DDC which can talk to display drivers, and DCC is "Direct Client to Client" (which was an IRC helper-protocol, wasn't it?) – Shalom Craimer Apr 20 '09 at 06:26
  • 1
    http://en.wikipedia.org/wiki/Display_Data_Channel has some details – Luke Quinane Apr 20 '09 at 07:05

2 Answers2

1

Call the EnumDisplayDevices function.

Raul Agrait
  • 5,938
  • 6
  • 49
  • 72
  • Unfortuently that function does not change in real time. I trying to detect when someone unplugs a monitor. MSDN seems to indicate use of DDC was only added to winapi in Vista. – Myforwik Apr 22 '09 at 05:35
  • You should've put in your question that you wanted to hook the unplug event. I just asked the same question but it turns out I'm not the first: - http://stackoverflow.com/questions/1440285/how-to-detect-hot-plugging-of-monitor-in-a-win32-application - http://stackoverflow.com/questions/3267722/getting-an-event-on-monitor-hotplug-for-windows http://stackoverflow.com/questions/5981520/detect-external-display-being-connected-or-removed-under-windows-7 – hippietrail May 13 '11 at 08:19
0

Not a free solution but the only one that I've been able to find so far:

http://www.nicomsoft.com/wini2cddc/

Simon Elliott
  • 2,087
  • 4
  • 30
  • 39