Can anyone point me to (preferably C#, C++ ok) source code to change display mode back and forth between mirror (duplicate) display mode vs extended mode? Need to target Win7 x86/x64 dual-monitor PCs and need code that's display driver independent. This for an app that reads desired video settings from registry and sets up displays accordingly.
Essentially I want to replicate what happens on Win7 when you hit Windows-P and select Duplicate or Extend.
WMI or not WMI is good. Prefer something expected to be portable to future Windows versions.