Programmatically change screen resolution?

jacobsee picture jacobsee · Oct 18, 2008 · Viewed 25.4k times · Source

Is there a way to programmatically change the screen resolution or enable/disable multiple monitors in Windows XP? For example to change from 1024x768 with one monitor to 1280x104 on two monitors? I would be most interested in a win32 function to do this but anything that can be tied to a windows shortcut would suffice.

Answer

Ferruccio picture Ferruccio · Oct 18, 2008

You can use EnumDisplayDevices to figure out what displays you have available and EnumDisplaySettings to get a list of available resolutions for your displays. Use ChangeDisplaySettings to set the resolution you need.