Fix window maximising to it's minimum size

This commit is contained in:
Doyle Thai 2017-04-07 21:30:47 +10:00
parent dd4ae0d793
commit ea1f8dcc38

View File

@ -184,9 +184,15 @@ FILE_SCOPE LRESULT CALLBACK win32_main_proc_callback(HWND window, UINT msg,
case WM_GETMINMAXINFO:
{
RECT rect = {};
rect.right = MIN_WIDTH;
rect.bottom = MIN_HEIGHT;
DWORD windowStyle = (DWORD)GetWindowLong(window, GWL_STYLE);
AdjustWindowRect(&rect, windowStyle, true);
MINMAXINFO *mmi = (MINMAXINFO *)lParam;
mmi->ptMaxSize.x = MIN_WIDTH;
mmi->ptMaxSize.y = MIN_HEIGHT;
mmi->ptMinTrackSize.x = rect.left - rect.right;
mmi->ptMinTrackSize.y = rect.bottom - rect.top;
}
break;