From 68130d341d021575517ef2fdd600b57eb6f0f7f2 Mon Sep 17 00:00:00 2001 From: simon Date: Thu, 4 Nov 1999 13:44:21 +0000 Subject: [PATCH] Prompt before summarily closing a session git-svn-id: svn://svn.tartarus.org/sgt/putty@272 cda61777-01e9-0310-a592-d414129be87e --- window.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/window.c b/window.c index 8c82af9a..10650edb 100644 --- a/window.c +++ b/window.c @@ -616,6 +616,12 @@ static int WINAPI WndProc (HWND hwnd, UINT message, switch (message) { case WM_CREATE: break; + case WM_CLOSE: + if (MessageBox(hwnd, "Are you sure you want to close this session?", + "PuTTY Exit Confirmation", + MB_ICONWARNING | MB_OKCANCEL) == IDOK) + DestroyWindow(hwnd); + return 0; case WM_DESTROY: PostQuitMessage (0); return 0; @@ -1248,7 +1254,7 @@ static int TranslateKey(WPARAM wParam, LPARAM lParam, unsigned char *output) { return 0; } if ((lParam & 0x20000000) && wParam == VK_F4) { - SendMessage (hwnd, WM_DESTROY, 0, 0); + SendMessage (hwnd, WM_CLOSE, 0, 0); return 0; } -- 2.11.0