From 5e9e124aa9c5e227aa2cac84b850e1c50fc1e34d Mon Sep 17 00:00:00 2001 From: owen Date: Thu, 19 Jun 2003 23:04:50 +0000 Subject: [PATCH] Fix problem quitting terminal window while Change Settings active git-svn-id: svn://svn.tartarus.org/sgt/putty@3280 cda61777-01e9-0310-a592-d414129be87e --- winmisc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/winmisc.c b/winmisc.c index caafd7d7..916e9885 100644 --- a/winmisc.c +++ b/winmisc.c @@ -47,6 +47,7 @@ int SaneDialogBox(HINSTANCE hinst, MSG msg; int flags; int ret; + int gm; wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW; wc.lpfnWndProc = DefDlgProc; @@ -65,7 +66,7 @@ int SaneDialogBox(HINSTANCE hinst, SetWindowLong(hwnd, BOXFLAGS, 0); /* flags */ SetWindowLong(hwnd, BOXRESULT, 0); /* result from SaneEndDialog */ - while (GetMessage(&msg, NULL, 0, 0)) { + while ((gm=GetMessage(&msg, NULL, 0, 0)) > 0) { flags=GetWindowLong(hwnd, BOXFLAGS); if (!(flags & DF_END) && !IsDialogMessage(hwnd, &msg)) DispatchMessage(&msg); @@ -73,6 +74,9 @@ int SaneDialogBox(HINSTANCE hinst, break; } + if (gm == 0) + PostQuitMessage(msg.wParam); /* We got a WM_QUIT, pass it on */ + ret=GetWindowLong(hwnd, BOXRESULT); DestroyWindow(hwnd); return ret; -- 2.11.0