SetMonitorDisplayAreaSize function

Sets the width or height of a monitor's display area.


_BOOL SetMonitorDisplayAreaSize(
  HANDLE       hMonitor,
  MC_SIZE_TYPE stSizeType,
  DWORD        dwNewDisplayAreaWidthOrHeight



Handle to a physical monitor. To get the monitor handle, call GetPhysicalMonitorsFromHMONITOR or GetPhysicalMonitorsFromIDirect3DDevice9.


A member of the MC_SIZE_TYPE enumeration, specifying whether to set the width or the height.


Display area width or height. To get the minimum and maximum width and height, call GetMonitorDisplayAreaSize.

Return Value

If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE. To get extended error information, call GetLastError.


If this function is supported, the GetMonitorCapabilities function returns the MC_CAPS_DISPLAY_AREA_SIZE flag.

This function takes about 50 milliseconds to return.

The width and height settings are continuous monitor settings. For more information, see Using the High-Level Monitor Configuration Functions.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header highlevelmonitorconfigurationapi.h
Library Dxva2.lib
DLL Dxva2.dll

See Also

Monitor Configuration Functions