Added: window adjustment
This commit is contained in:
@@ -16,15 +16,19 @@ INT Window::init(HINSTANCE hInstance, UINT width, UINT height)
|
||||
if (!RegisterClass(&wc)) return 100;
|
||||
|
||||
// 3. adjust window size (optional)
|
||||
DWORD style = WS_OVERLAPPEDWINDOW; // window with title bar & some more decorations
|
||||
//DWORD style = WS_POPUP; // window without any decorations
|
||||
|
||||
RECT rect = { 100, 100, 100 + width, 100 + height }; // left-top & bottom-right corners
|
||||
AdjustWindowRect(&rect, style, FALSE);
|
||||
|
||||
// 4. create window instance
|
||||
_hWnd = CreateWindow(
|
||||
wc.lpszClassName, // class name
|
||||
wc.lpszClassName, // window title
|
||||
WS_OVERLAPPEDWINDOW, // visual style
|
||||
100, 100, // window position (left-top corner)
|
||||
width, height, // window size
|
||||
style, // visual style
|
||||
rect.left, rect.top, // window position (left-top corner)
|
||||
rect.right - rect.left, rect.bottom - rect.top, // window size
|
||||
nullptr, // optional handle to a parent window
|
||||
nullptr, // optional handle to a menu instance
|
||||
hInstance,
|
||||
|
||||
Reference in New Issue
Block a user