Skip to content

Commit

Permalink
Windows: Adjust window size to fit client area
Browse files Browse the repository at this point in the history
  • Loading branch information
Deltafire committed Mar 12, 2017
1 parent 81caa6b commit 154b938
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/tracker/win32/Win32_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,23 +1113,28 @@ static BOOL AppInit(HINSTANCE hinst,int nCmdShow)
windowSize.width = 320;
windowSize.height = 240;
#endif

RECT rect;
rect.left = rect.top = 0;
rect.right = windowSize.width;
rect.bottom = windowSize.height;

#ifdef FULLSCREEN
AdjustWindowRect(&rect, WS_POPUP, false);
hWnd = CreateWindow(c_szClassName,
WINDOWTITLE,
WS_POPUP/*|WS_SYSMENU/*|WS_MAXIMIZEBOX|WS_MINIMIZEBOX*/,CW_USEDEFAULT,CW_USEDEFAULT,
windowSize.width + ::GetSystemMetrics(SM_CXEDGE)*2,
windowSize.height + ::GetSystemMetrics(SM_CYCAPTION)+::GetSystemMetrics(SM_CYEDGE)*2,
rect.right - rect.left, rect.bottom - rect.top,
NULL,
NULL,
g_hinst,
0);
#else
AdjustWindowRect(&rect, WS_SYSMENU/*|WS_MAXIMIZEBOX*/|WS_MINIMIZEBOX, false);
hWnd = CreateWindow(c_szClassName,
WINDOWTITLE,
WS_SYSMENU/*|WS_MAXIMIZEBOX*/|WS_MINIMIZEBOX,CW_USEDEFAULT,CW_USEDEFAULT,
windowSize.width + ::GetSystemMetrics(SM_CXEDGE)*2+2,
windowSize.height + ::GetSystemMetrics(SM_CYCAPTION)+2+::GetSystemMetrics(SM_CYEDGE)*2,
rect.right - rect.left, rect.bottom - rect.top,
NULL,
NULL,
g_hinst,
Expand Down

0 comments on commit 154b938

Please sign in to comment.