tags:

views:

393

answers:

1

I am using WMI Win32_MonitorDesktop to get all the monitors on the system.

However it only returns one. I have tried it on several computers, and they deffinately have multiple monitors on them, connected and working.

ManagementObjectSearcher monitorObjectSearch = new ManagementObjectSearcher("SELECT * FROM Win32_DesktopMonitor");

foreach (ManagementObject monitor in monitorObjectSearch.Get())
{
      Debug.WriteLine(monitor["Description"]);
}

Does anyone know why i'm only getting 1 monitor returned?

Also if i assign the return value of monitorObjectSearch.Get() to a variable, I am unable to evaluate the Count property in the immediate window as the function always times out.

+1  A: 

It could be that the monitors are set up in a horizontal span mode (NV and ATI cards) which effectively make multiple monitor setups into one big monitor? Otherwise, I'll continue to have a think..

Also the MSDN quite specifically states that if this WMI call is used with anything pre-vista it will yield inaccurate results!?

Siyfion
The setup is two different desktops not as one big monitor. I'm on vista, both 64 and 32.
JFoulkes