Using win32 I create a window like this:
RECT windowRect = {0, 0, width, height};
AdjustWindowRectEx(&windowRect, WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME, FALSE, WS_EX_APPWINDOW);
mWindowHandle = CreateWindow(wcex.lpszClassName, wcex.lpszClassName, WS_OVERLAPPED | WS_CAPTION | WS_THICKFRAME,
CW_USEDEFAULT, CW_USEDEFAULT, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top,
nullptr, nullptr, mInstanceHandle, nullptr);
For example, right now I have 1920x1080 max, if I pass those values the client area will have 1920x1080, but the overall window size will be too large, dissapearing off-screen.
width
and height
are arbitary values passed to the function. The effect I want to achieve is that if it is set to the maximum (or above) the resolution of the screen, the whole window will be clamped to fit the screen.
Is there an easy way to do this in win32?