mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-05-30 16:30:29 -05:00
Prompt before summarily closing a session
[originally from svn r272]
This commit is contained in:
parent
ce35a4ab94
commit
7205ae9199
8
window.c
8
window.c
@ -616,6 +616,12 @@ static int WINAPI WndProc (HWND hwnd, UINT message,
|
|||||||
switch (message) {
|
switch (message) {
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
break;
|
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:
|
case WM_DESTROY:
|
||||||
PostQuitMessage (0);
|
PostQuitMessage (0);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1248,7 +1254,7 @@ static int TranslateKey(WPARAM wParam, LPARAM lParam, unsigned char *output) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((lParam & 0x20000000) && wParam == VK_F4) {
|
if ((lParam & 0x20000000) && wParam == VK_F4) {
|
||||||
SendMessage (hwnd, WM_DESTROY, 0, 0);
|
SendMessage (hwnd, WM_CLOSE, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user