Click here to Skip to main content
13,097,926 members (58,167 online)
Rate this:
Please Sign up or sign in to vote.
Does anyone know how to detect if multiple monitors are running in cloned mode? Seems easy, huh?

I thought so too, but I've been searching for weeks! I've tried EnumDisplayDevices which works on one machine, but not on another. The one it doesn't work on is a laptop with an extended cloned moniter (both images are the same on each monitor). EnumDisplayDevices shows one Display Device attached and only one Monitor attached and primary; however, on the working machine it shows one Display Device attached/primary and two monitors attached/primary (what i use for indicating cloned mode). I've also tried some WMI like Win32_DesktopMonitors, but to no avail! PLEASE HELP ME!

The 'Intel Graphics Accelerator Driver for mobile' even says that the displays Operating Mode is "Intel(R) Dual Display Clone"

Could that be stored in the registry somewhere? Is there an API call?

There has to be a simple one liner! I know it! Anyone?

Posted 9-Jul-10 12:39pm
Updated 13-Jul-10 4:42am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

You need the QueryDisplayConfig function via user32.dll.
The parameter pCurrentTopologyId determines whether multiple monitors run in cloned mode.
See the DISPLAYCONFIG_TOPOLOGY_ID enumeration for interpretation.

I found this subproject on GitHub: MultiMonitorHelper
Line 86 in DisplayModels/Win7/Win7DisplayModel.Helper.cs:
// topology ID only valid with QDC_DATABASE_CURRENT
var queryDisplayStatus = pathType == QueryDisplayFlags.DatabaseCurrent ?
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray, out topologyId) :
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray);
dc_d00de 21-May-15 7:28am
Reason for my vote of 5:
Used exactly the same solution to get the information.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Whatever solution you can find will be unreliable.
This is one of the thing you cannot too much messing in, since it mostly deals with the OS / to Driver interaction.

The OS API tells you how the video drivers shows the display(s) to the system. If I have a device deriver that makes 3x3 displays look to the OS as a single "megamonitor" there is no way for you to know the "physics".

Whether you like it or not, your program will always run on top of "virtual resources". That may differ from the physical.
Nishant Sivakumar 13-Jul-10 11:16am
Reason for my vote of 5
Worth 5!
Member 3790038 13-Jul-10 12:07pm
Reason for my vote of 3
The video driver shows correctly, but the EnumDisplayDevice API doesn't.
emilio_grv 14-Jul-10 8:33am
That's why the driver hides to the OS the physical detail. If it was designed that way, the OS will never know about. If you can access the driver, call the driver.
Member 3790038 15-Jul-10 17:27pm
I can access the driver; but, unfortunately, this solution must work on any workstation with any driver. Is there a universal API for communicating with video drivers? If there is, then that would work.
emilio_grv 15-Jul-10 17:42pm
As I told you, the API is the one you used. It tells you what the driver tells to the OS (that may be different from what the driver can directly tell you with its own direct API. It not a matter of "universal API" but of "univarsal protocol" (that does not exist yet) between MS and the driver manufacturer.
More than this, I cannot tell you.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Thanks for following up with my question Emilio. From my experience as well, the information reported is unreliable. However, with the new Windows Logo Program, there is a push for manufacturers of monitors to provide accurate EDID information down to the OS.

In addtion, all new monitors must provide EDID information to the PCs which they are connected, even if the monitors are on a KVM switch. That being said, I have been able to retrieve the "Physical" dimensions of attached monitors in most cases. For older monitors, the EDID is sometimes inaccurate, corrupt, or non-existent.

Regarding cloned mode, it seems as if I can reliably detect Cloned Mode on desktop computers. But, for laptop computers, I cannot detect Cloned Mode. At this time, I believe the reason why has something to do with the ‘Extended Monitor’ port on the back of laptops. Perhaps, if there was a way for me to detect a monitor plugged into the ‘Extended’ port, then I would be able to extrapolate Cloned Mode by checking if the Screen.AllScreens.Length returns only 1 and there is a monitor plugged into the extended monitor port, but I need to test this scenario extensively before drawing any conclusions.

It seems that the drivers accurately report this information, so it should be available through an API, right? There has to be a simple API call that I'm not aware of to detect Cloned Mode (i.e. GetDisplayMode or GetDisplayOperation).


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.170813.1 | Last Updated 3 Sep 2014
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100