From b335db994aedaded9859250b93e8cd5ea8744a38 Mon Sep 17 00:00:00 2001 From: Brady McDermott Date: Sun, 20 Oct 2024 21:15:17 -0600 Subject: [PATCH] registry.... wndproc --- progmgr/registry.c | 5 +---- progmgr/wndproc.c | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/progmgr/registry.c b/progmgr/registry.c index 701aab4..223cc6f 100644 --- a/progmgr/registry.c +++ b/progmgr/registry.c @@ -336,11 +336,8 @@ DWORD LoadConfig(_In_ BOOL bSettings, _In_ BOOL bPos, _In_ BOOL bGroups) } // retrieve the group - // TODO: add error_checking, ERROR_FILE_NOT_FOUND - // stuff like that, please - // error checking makes reliability.... error = RegGetValue(hKeyProgramGroups, NULL, szGroupValName, RRF_RT_REG_BINARY, NULL, pGroup, &cbGroup); - /*error = RegQueryValueEx(hKeyProgramGroups, szGroupValName, NULL, NULL, pGroup, &cbGroup);*/ + if (error == ERROR_FILE_NOT_FOUND) { OutputDebugString(TEXT("REGISTRY.C: Group not found!\n")); diff --git a/progmgr/wndproc.c b/progmgr/wndproc.c index c3bd992..6ffb155 100644 --- a/progmgr/wndproc.c +++ b/progmgr/wndproc.c @@ -68,6 +68,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam); case WM_CLOSE: + case WM_ENDSESSION: if (bSaveSettings) SaveConfig(TRUE, TRUE, TRUE, TRUE); @@ -77,10 +78,6 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) PostQuitMessage(0); break; - case WM_ENDSESSION: - PostQuitMessage(0); - break; - default: return DefFrameProc(hWnd, hWndMDIClient, message, wParam, lParam); }