I posted this question in the C# forum, but felt that those on this forum might be able to help as well.
I have a project that requires me to gather inventory data for my computer. I am having problems trying to get the properties of the monitors attached to my computer.
I have one computer that can potentially use a max of 4 monitors, wherein I have a primary monitor and 3 other potential monitors which act as extension screens when I move my mouse to them ( depending on whether they are connected or not ).
I need to grab the following information from each monitor :
Horizontal and Vertical resolution,
Whether or not the monitor is the primary one ( a true or false value will suffice ).
I tried using the WMI, Win32_DesktopMonitor class but it is only giving me ONE monitor's results ( the primary monitor ).
I then tried using the Win32_PnPEntity class.
This works, and gives me the number of monitors attached to my computer, but it only gives me Name and DeviceId ( no horizontal and vertical resolution information in this class ).
I then tried the Screen class (using the System.Windows.Forms.Screen), however the result is erratic. In one environment, it gives me the right number of monitors attached to my computer, in others, it does not.
Does anyone know of a Class provided by .NET 4 that will help me gather the information I need?
I am using .NET Framework 4 and building my application as a Console Application.
Any suggestions and advise will be highly appreciated.