The presentation display modes are those you see when using the Windows+p shortcut:
Do any API calls exist which allow one to switch between these display modes?
I want to programmatically switch between monitor and HDMI TV (and do a bunch of other things simultaneously, hence Windows+p not being useful), but I'm hitting a brick wall.
You can obtain and change the display setting using EnumDisplaySettingsEx and ChangeDisplaySettingsEx:
The ChangeDisplaySettingsEx function changes the settings of the specified display device to the specified graphics mode.
Check this Codeproject project and this Stackoverflow question for example code
You can set the desktop display mode with SetDisplayConfig() eg.
SetDisplayConfig(0, NULL, 0, NULL, SDC_TOPOLOGY_EXTERNAL | SDC_APPLY);
You can retrieve the current display mode with QueryDisplayConfig(). eg.
DISPLAYCONFIG_TOPOLOGY_ID currentTopology;
QueryDisplayConfig(QDC_DATABASE_CURRENT, &PathArraySize, PathArray, &ModeArraySize, ModeArray, ¤tTopology);
(Related source for this call here)
This is for C++. C# would require DLL imports.
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