From bcf3899e6805a7cb3c0a760d4210bf0cafe45949 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 13 Apr 2007 19:59:30 +0000 Subject: [PATCH] instead of forwarding the X button to the Next button when the Cancel button is disabled on the last page, simply disable the X button when the Cancel button is disabled (part of bug #1267491) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5067 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/exehead/Ui.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Source/exehead/Ui.c b/Source/exehead/Ui.c index 1cf18da6..2bf6432e 100644 --- a/Source/exehead/Ui.c +++ b/Source/exehead/Ui.c @@ -543,6 +543,11 @@ nextPage: EnableNext(pflags & PF_NEXT_ENABLE); EnableWindow(m_hwndCancel, pflags & PF_CANCEL_ENABLE); + if (pflags & PF_CANCEL_ENABLE) + EnableMenuItem(GetSystemMenu(hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_ENABLED); + else + EnableMenuItem(GetSystemMenu(hwndDlg, FALSE), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED); + SendMessage(hwndtmp, BM_SETSTYLE, BS_PUSHBUTTON, TRUE); if (g_exec_flags.abort) @@ -636,14 +641,6 @@ skipPage: SetWindowLong(hwndDlg, DWL_MSGRESULT, FALSE); return TRUE; } - if (uMsg == WM_CLOSE && m_page == g_blocks[NB_PAGES].num - 1) - { - if (!IsWindowEnabled(m_hwndCancel)) - { - uMsg = WM_COMMAND; - wParam = IDOK; - } - } if (uMsg == WM_COMMAND) { int id = LOWORD(wParam);