add adjust window rect

This commit is contained in:
2025-09-24 13:10:15 +02:00
parent 53cf8b96a3
commit 5322f857d3
+5 -2
View File
@@ -22,13 +22,16 @@ INT Window::init(HINSTANCE hInstance, UINT width, UINT height)
style = WS_OVERLAPPEDWINDOW; // window with border & title
//style = WS_POPUP; // window without any border or title
RECT rect = { 100, 100, width + 100, height + 100 }; // left top right bottom
AdjustWindowRect(&rect, style, FALSE);
// 4. create window instance
_hWnd = CreateWindow(
wc.lpszClassName, // class name of window class to be instantiated
wc.lpszClassName, // window title
style, // visual style
100, 100, // window position (left-top corner)
width, height, // window size
rect.left, rect.top, // window position (left-top corner)
rect.right - rect.left, rect.bottom - rect.top, // window size
nullptr, // handle to parent window
nullptr, // handle to menu instance
hInstance,