Group: Device Context - Library: user32
The ChangeDisplaySettings function changes the settings of the default display device to the specified graphics mode.
How to change display settings: screen resolution, screen refresh rate
LONG ChangeDisplaySettings(
LPDEVMODE lpDevMode, // graphics mode
DWORD dwflags // graphics mode options
);
DECLARE INTEGER ChangeDisplaySettings IN user32;
STRING @ lpDevMode,;
INTEGER dwflags
lpDevMode [in] Pointer to a DEVMODE structure that describes the new graphics mode.
dwflags [in] Indicates how the graphics mode should be changed.
The ChangeDisplaySettings function returns one of the predefined values, e.g. DISP_CHANGE_SUCCESSFUL (0).
Specifying CDS_TEST as dwflags allows an application to determine which graphics modes are actually valid, without causing the system to change to that graphics mode.
To change the settings of a specified display device, use the ChangeDisplaySettingsEx function.