1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-18 03:28:07 -05:00

Fix problem quitting terminal window while Change Settings active

[originally from svn r3280]
This commit is contained in:
Owen Dunn 2003-06-19 23:04:50 +00:00
parent 8369c4384d
commit 2fa49b7139

View File

@ -47,6 +47,7 @@ int SaneDialogBox(HINSTANCE hinst,
MSG msg; MSG msg;
int flags; int flags;
int ret; int ret;
int gm;
wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW; wc.style = CS_DBLCLKS | CS_SAVEBITS | CS_BYTEALIGNWINDOW;
wc.lpfnWndProc = DefDlgProc; wc.lpfnWndProc = DefDlgProc;
@ -65,7 +66,7 @@ int SaneDialogBox(HINSTANCE hinst,
SetWindowLong(hwnd, BOXFLAGS, 0); /* flags */ SetWindowLong(hwnd, BOXFLAGS, 0); /* flags */
SetWindowLong(hwnd, BOXRESULT, 0); /* result from SaneEndDialog */ 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); flags=GetWindowLong(hwnd, BOXFLAGS);
if (!(flags & DF_END) && !IsDialogMessage(hwnd, &msg)) if (!(flags & DF_END) && !IsDialogMessage(hwnd, &msg))
DispatchMessage(&msg); DispatchMessage(&msg);
@ -73,6 +74,9 @@ int SaneDialogBox(HINSTANCE hinst,
break; break;
} }
if (gm == 0)
PostQuitMessage(msg.wParam); /* We got a WM_QUIT, pass it on */
ret=GetWindowLong(hwnd, BOXRESULT); ret=GetWindowLong(hwnd, BOXRESULT);
DestroyWindow(hwnd); DestroyWindow(hwnd);
return ret; return ret;