title: How can I force display detection in Windows?
body: <p>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).</p>
  
  <p>I can correct this by right-clicking the desktop, choosing <code>Screen Resolution</code> and clicking <code>Detect</code>. This makes Windows detect attached displays and adjust to the most optimal resolution.  </p>
  
  <p>I would like to write a small utility to do this automatically. Which Win32 API call or C# object should I use?</p>