Re: Determining physical VGA/DVI port a monitor is connected to

Tech-Archive recommends: Fix windows errors by optimizing your registry



I've found an easier method of achieving what I want. Basically, I
need to know which monitor corresponds to which of the displays. This
is the method that I came up with (here for completeness):

1. Use the usual EnumDisplayDevices() method to get a DISPLAY_DEVICE
struct for the monitor.
2. Parse the last part of the DeviceKey member in DISPLAY_DEVICE
struct, starting from the first '{'.
3. Use SetupDiGetClassDevs() with GUID_CLASS_MONITOR, then use
SetupDiEnumDeviceInfo() to get all monitors
4. For each monitor, look at the registry entry
5. Look for a "Driver" REG_SZ value
6. Compare that value to the parsed DeviceKey value to find a match
7. Then from looking at the EDID information, you can determine which
monitor is used as the primary, secondary, etc monitor

Seems like a whole lotta work :( I bet there's an easier way out
there.. o well

Cheers,
Edmund

On Mar 6, 7:00 pm, edmund.sz...@xxxxxxxxx wrote:
Hi All,

I am wondering if its possible to determine in user mode which video
port a monitor is connected to. For example, say I have a nVidia
Quadro FX 1600M video card that has two DVI ports, can I tell which
monitor is connected to which of the DVI ports?

I have already looked at the EnumDisplayDevices() and
EnumDisplaySettings() functions. They are useful for getting the
position/resolution of the monitors, but I cannot tell which port each
monitor is connected to.

Thanks in advance!
Edmund

.



Relevant Pages

  • xp not recognizing DVI monitor
    ... Need some help - On the most recent system I put together I use an XFX GF6600 DDR PCI-E board hooked to a Dell 2005FPW LCD monitor using a standard VGA cable. ... However, when I then I try to switch from VGA to the DVI ports, the screen goes blank after Windows starts to load. ... I thought it might be a DVI-D versus DVI-I cabling issue but then the boot screen and initial load screens are fine. ...
    (alt.comp.hardware.pc-homebuilt)
  • RE: ICM Monitor (Display) profile
    ... To obtain information on a display monitor, first call EnumDisplayDevices ... Then call EnumDisplayDevices with lpDevice set ...
    (microsoft.public.win32.programmer.gdi)
  • RE: ICM Monitor (Display) profile
    ... > To obtain information on a display monitor, first call EnumDisplayDevices ... Then call EnumDisplayDevices with lpDevice set ... >> and the corresponding ICM monitor profile? ...
    (microsoft.public.win32.programmer.gdi)
  • Re: How to programmatically get a monitors "Identify" number?
    ... routine does refer to the coordinates, ... This returns the monitor info in an array. ... I would imagine that when you call EnumDisplayDevices with NULL in the ...
    (microsoft.public.win32.programmer.directx.video)
  • Re: How to programmatically get a monitors "Identify" number?
    ... it doesn't look like EnumDisplayDevices returns the monitor ... DeviceName, which is then passed to EnumDisplaySettingsEx to get ... Iain Downs (DirectShow MVP) ...
    (microsoft.public.win32.programmer.directx.video)