I often boot my Windows 7 PC with the attached KVM switch focused on another computer. When I switch to the booted PC, the display resolution is wrong (and the second attached monitor is not detected).
I can correct this by right-clicking the desktop, choosing Screen Resolution
and clicking Detect
. This makes Windows detect attached displays and adjust to the most optimal resolution.
I would like to write a small utility to do this automatically. Which Win32 API call or C# object should I use?