From: Gregor Schneider Date: Sun, 25 Apr 2010 12:13:01 +0000 (+0000) Subject: [SYSSETUP] X-Git-Tag: backups/header-work@57446~33^2~68 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=49496ddec65489aaf0bc692533892f5aaa5e131b [SYSSETUP] - Create a modeless syssetup dialog so we can explicitly ignore intermediate WM_CLOSE messages (modal property sheets handle them automatically) See issue #4960 for more details. svn path=/trunk/; revision=47011 --- diff --git a/reactos/dll/win32/syssetup/wizard.c b/reactos/dll/win32/syssetup/wizard.c index 7a084f56c26..63d6bc2ed88 100644 --- a/reactos/dll/win32/syssetup/wizard.c +++ b/reactos/dll/win32/syssetup/wizard.c @@ -1960,6 +1960,7 @@ FinishDlgProc(HWND hwndDlg, case WM_DESTROY: { SetupIsActive(0); + PostQuitMessage(0); return TRUE; } @@ -1999,7 +2000,7 @@ FinishDlgProc(HWND hwndDlg, break; case PSN_WIZFINISH: - /* Handle a Finish button click, if necessary */ + DestroyWindow(GetParent(hwndDlg)); break; default: @@ -2269,6 +2270,8 @@ InstallWizard(VOID) HPROPSHEETPAGE ahpsp[8]; PROPSHEETPAGE psp = {0}; UINT nPages = 0; + HWND hWnd; + MSG msg; /* Clear setup data */ ZeroMemory(&SetupData, sizeof(SETUPDATA)); @@ -2345,7 +2348,7 @@ InstallWizard(VOID) /* Create the property sheet */ psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER; + psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_HEADER | PSH_MODELESS; psh.hInstance = hDllInstance; psh.hwndParent = NULL; psh.nPages = nPages; @@ -2358,7 +2361,17 @@ InstallWizard(VOID) SetupData.hTitleFont = CreateTitleFont(); /* Display the wizard */ - PropertySheet(&psh); + hWnd = (HWND)PropertySheet(&psh); + ShowWindow(hWnd, SW_SHOW); + + while (GetMessage(&msg, NULL, 0, 0)) + { + if(!IsDialogMessage(hWnd, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } DeleteObject(SetupData.hTitleFont); }