From 3c0d6ab2cc66a83951f19d59b538f502c4010da6 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sat, 12 Feb 2022 01:01:17 +0100 Subject: [PATCH] WM_SHUTDOWN now no longer asks for confirmation if WPARAM == 1. --- src/win/win_ui.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/win/win_ui.c b/src/win/win_ui.c index be5ab760d..a1616200b 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -1012,21 +1012,29 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WM_SHUTDOWN: if (manager_wm) break; - win_notify_dlg_open(); - if (confirm_exit && confirm_exit_cmdl) - i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL); - else - i = 0; - if ((i % 10) == 0) { - if (i == 10) { - confirm_exit = 0; - nvr_save(); - config_save(); - } + if (LOWORD(wParam) == 1) { + confirm_exit = 0; + nvr_save(); + config_save(); KillTimer(hwnd, TIMER_1SEC); PostQuitMessage(0); + } else { + win_notify_dlg_open(); + if (confirm_exit && confirm_exit_cmdl) + i = ui_msgbox_ex(MBX_QUESTION_YN | MBX_DONTASK, (wchar_t *) IDS_2113, NULL, (wchar_t *) IDS_2119, (wchar_t *) IDS_2136, NULL); + else + i = 0; + if ((i % 10) == 0) { + if (i == 10) { + confirm_exit = 0; + nvr_save(); + config_save(); + } + KillTimer(hwnd, TIMER_1SEC); + PostQuitMessage(0); + } + win_notify_dlg_closed(); } - win_notify_dlg_closed(); break; case WM_CTRLALTDEL: