I've been looking into ways to programmatically manage my monitors using C++.
It looks like functions like EnumDisplayDevices, EnumDisplaySettings and ChangeDisplaySettings can be used to, e.g., change the resolution of individual display devices and attaching/detaching said devices to/from the desktop.
In addition to these operations, I want to be able to duplicate my desktop to multiple monitors.
A concrete example would be to go from this setup where the desktop spans two devices...
...to this setup, where the desktop is instead duplicated to said devices.
I have tried investigating the APIs on MSDN, and looking for similar questions, but cannot seem to find any indication as to whether or not this is possible to do.
Is it possible to use C++ to duplicate my desktop to multiple display devices, and if so, how? If not, is it then possible to do it some other way, e.g. using another programming language, or am I forced to use options like the Windows Control Panel to change such settings?
SetDisplayConfig and DISPLAYCONFIG_TOPOLOGY_CLONE
Here's a PAQ w/code using this function to switch to extended mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With