Screen.AllScreen не дает правильного количества мониторов

I am doing something like this in my program:

Int32 currentMonitorCount = Screen.AllScreens.Length;

if  (currentMonitorCount < 2)
{
   //Put app in single screen mode.
}
else
{
   //Put app in dual screen mode.
}

It is VERY important my application recognizes how many monitors are currently connected.

However, after I plug/unplug the monitor a couple of times, Screen.AllScreens.Length always returns '2'.

My monitor knows it's not connected (it has entered 'power save' mode), and the control panel knows that it's not connected (it shows only one monitor).

So what am I missing? How do I figure out that there's only one monitor?

15
задан Henk Holterman 16 February 2011 в 18:41
поделиться