AdjustWindowRectExForDpi function (winuser.h)
Calculates the required size of the window rectangle, based on the desired size of the client rectangle and the provided DPI. This window rectangle can then be passed to the CreateWindowEx function to create a window with a client area of the desired size.
BOOL AdjustWindowRectExForDpi( [in, out] LPRECT lpRect, [in] DWORD dwStyle, [in] BOOL bMenu, [in] DWORD dwExStyle, [in] UINT dpi );
[in, out] lpRect
A pointer to a RECT structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client area.
The Window Style of the window whose required size is to be calculated. Note that you cannot specify the WS_OVERLAPPED style.
Indicates whether the window has a menu.
The Extended Window Style of the window whose required size is to be calculated.
The DPI to use for scaling.
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
This function returns the same result as AdjustWindowRectEx but scales it according to an arbitrary DPI you provide if appropriate.
|Minimum supported client||Windows 10, version 1607 [desktop apps only]|
|Minimum supported server||None supported|
|Header||winuser.h (include Windows.h)|