From 2b2672b9fdd47e40fdab53bc0ab9c21b23a1522a Mon Sep 17 00:00:00 2001 From: andreja6 Date: Tue, 24 Apr 2018 18:23:07 -0700 Subject: [PATCH] Now resizes with hwnd but controls are dead asgassdsad --- main.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index c508ab0..a66d5b7 100644 --- a/main.cpp +++ b/main.cpp @@ -1174,6 +1174,21 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_DESTROY: PostQuitMessage(0); break; + case WM_SIZE: + if(app != 0) + { + HWND g3DWind = app->getHWND(); + int width = 640; + int height = 480; + RECT rect; + if(GetClientRect(hwnd, &rect)) + { + width = rect.right - rect.left; + height = rect.bottom - rect.top; + } + SetWindowPos(g3DWind, NULL, 0, 0, width, height, NULL); + } + break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } @@ -1244,7 +1259,7 @@ int main(int argc, char** argv) { RECT rect; int width = 640; int height = 480; - if(GetWindowRect(hwndMain, &rect)) + if(GetClientRect(hwndMain, &rect)) { width = rect.right - rect.left; height = rect.bottom - rect.top;