Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
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?

Thanks!
Posted
Updated 13-Jul-10 4:42am
v3

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:
C#
// topology ID only valid with QDC_DATABASE_CURRENT
var queryDisplayStatus = pathType == QueryDisplayFlags.DatabaseCurrent ?
CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray, out topologyId) :
CCDWrapper.QueryDisplayConfig(
pathType,
ref numPathArrayElements, pathInfoArray,
ref numModeInfoArrayElements, modeInfoArray);
 
Share this answer
 
Comments
dc_d00de 21-May-15 7:28am    
Reason for my vote of 5:
Used exactly the same solution to get the information.
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.
 
Share this answer
 
Comments
Nish Nishant 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 Garavaglia 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 Garavaglia 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.
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).

Anyone?
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900