How would one poll windows to see what monitors are attached and what resolution they are running at?
The quickest way to check if your Windows 10 computer supports multiple monitors is to go Settings, select System, and then Display. Scroll down and check if the Multiple displays option is available. If this is the case, this means that your machine supports multiple monitors.
Change settings from graphics configuration software Navigate to Desktop Properties. Select the desired monitor and choose the suitable resolution. Click Apply to save changes. Now do the same for the other monitor.
In C#: Screen
Class Represents a display device or multiple display devices on a single system. You want the Bounds
attribute.
foreach(var screen in Screen.AllScreens) { // For each screen, add the screen properties to a list box. listBox1.Items.Add("Device Name: " + screen.DeviceName); listBox1.Items.Add("Bounds: " + screen.Bounds.ToString()); listBox1.Items.Add("Type: " + screen.GetType().ToString()); listBox1.Items.Add("Working Area: " + screen.WorkingArea.ToString()); listBox1.Items.Add("Primary Screen: " + screen.Primary.ToString()); }
Use the Screen class.
You can see all of the monitors in the Screen.AllScreens
array, and check the resolution and position of each one using the Bounds
property.
Note that some video cards will merge two monitors into a single very wide screen, so that Windows thinks that there is only one monitor. If you want to, you could check whether the width of a screen is more than twice its height; if so, it's probably a horizontal span and you can treat it as two equal screens. However, this is more complicated and you don't need to do it. Vertical spans are also supported but less common.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With