I am trying to count the number of monitors attached to a machine ( not virtual displays, so two monitors running with clone would have one virtual display but two physical monitors ). I am currently counting the active monitors listed under the device manager. This works fine in Windows Vista and 7, but it seems that in Windows XP, there are occasionally phantom monitors that don't exist, seemingly caused by drivers of sorts.
When I had conflicting nVidia and ATI drivers on a single machine with two video adapters, I ended up getting 4 monitors listed even when only one was real. Phantom monitors could be deleted but would reappear when a real monitor was attached or detatched or if you tried to search for new hardware.
Also, laptops with drivers for a laptop dock would sometimes have anywhere from 1 to 7 extra phantom monitors even though the dock only added one extra monitor.
Is there another way to reliably count physical monitors? If not, does anyone know to reliably filter out the phantom monitors in XP?