diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c index 7a8417ff70..171a81e9b7 100644 --- a/dll/win32/msi/dialog.c +++ b/dll/win32/msi/dialog.c @@ -171,6 +171,11 @@ static const WCHAR szHyperLink[] = {'H','y','p','e','r','L','i','n','k',0}; static DWORD uiThreadId; static HWND hMsiHiddenWindow; +#ifdef __REACTOS__ +static HWND handle_parent_dialog[10] = { NULL }; +static UINT parent_level = 0; +#endif + static LPWSTR msi_get_window_text( HWND hwnd ) { UINT sz, r; @@ -3818,6 +3823,18 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg, return SendMessageW( (HWND) lParam, WM_CTLCOLORSTATIC, wParam, lParam ); case WM_DESTROY: +#ifdef __REACTOS__ + ERR("Entering WM_DESTROY with level of '%d'.\n", parent_level); + if (parent_level > 0) + { + if (dialog->hwnd == handle_parent_dialog[parent_level - 1]) + { + handle_parent_dialog[parent_level - 1] = NULL; + parent_level--; + ERR("Decrementing handle parent level to '%d'.\n", parent_level); + } + } +#endif dialog->hwnd = NULL; return 0; case WM_NOTIFY: @@ -3854,15 +3871,43 @@ static UINT dialog_run_message_loop( msi_dialog *dialog ) if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize)) style |= WS_MINIMIZEBOX; +#ifdef __REACTOS__ + if (parent_level > 0) + { + hwnd = CreateWindowW( szMsiDialogClass, dialog->name, style, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + handle_parent_dialog[parent_level - 1], NULL, NULL, dialog ); + } + else + { + hwnd = CreateWindowW( szMsiDialogClass, dialog->name, style, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + NULL, NULL, NULL, dialog ); + } +#else hwnd = CreateWindowW( szMsiDialogClass, dialog->name, style, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, dialog ); +#endif + if( !hwnd ) { ERR("Failed to create dialog %s\n", debugstr_w( dialog->name )); return ERROR_FUNCTION_FAILED; } +#ifdef __REACTOS__ + if (!handle_parent_dialog[parent_level]) + { + handle_parent_dialog[parent_level] = hwnd; + if (parent_level < 10) + { + parent_level++; + } + ERR("Incrementing handle parent level to '%d'.\n", parent_level); + } +#endif + ShowWindow( hwnd, SW_SHOW ); /* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */