add adjust window rect
This commit is contained in:
+5
-2
@@ -21,14 +21,17 @@ INT Window::init(HINSTANCE hInstance, UINT width, UINT height)
|
||||
DWORD style = {};
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user