From 7e3fcb1fc32477a603f0cc72e671c4a1ec49ce47 Mon Sep 17 00:00:00 2001 From: freedom7341 Date: Fri, 29 Sep 2023 17:57:55 -0600 Subject: [PATCH] ;ji oua eg uagr iua g --- progmgr/group.c | 16 +++++++++++++--- progmgr/wndproc.c | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/progmgr/group.c b/progmgr/group.c index 922732d..e56ea5d 100644 --- a/progmgr/group.c +++ b/progmgr/group.c @@ -118,7 +118,9 @@ HWND CreateGroupWindow(GROUP grp) mcs.cy = grp.rcGroup.bottom - grp.rcGroup.top; } mcs.style = WS_VISIBLE; - mcs.lParam = (LPARAM)&grp; + // TODO: should I pass the pointer to the group through here + // or is it better and easier to just do it with GWLP_USERDATA? + mcs.lParam = (LPARAM)NULL; if ((hWndGroup = (HWND)SendMessage(hWndMDIClient, WM_MDICREATE, 0, (LPARAM)(LPTSTR)&mcs)) == NULL) return NULL; @@ -232,7 +234,14 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa case WM_CREATE: { - break; + CREATESTRUCT* pCreateStruct; + MDICREATESTRUCT* pMDICreateStruct; + + // code borrowed from winprog + pCreateStruct = (CREATESTRUCT*)lParam; + pMDICreateStruct = (MDICREATESTRUCT*)pCreateStruct->lpCreateParams; + + return TRUE; } case WM_CLOSE: @@ -241,5 +250,6 @@ LRESULT CALLBACK GroupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa default: return DefMDIChildProc(hWnd, message, wParam, lParam); } - return 0; + + return TRUE; } diff --git a/progmgr/wndproc.c b/progmgr/wndproc.c index b3e8b3e..fa43375 100644 --- a/progmgr/wndproc.c +++ b/progmgr/wndproc.c @@ -35,7 +35,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_CREATE: { - break; + return TRUE; } case WM_SYSCOMMAND: