[MSI] Fix dialog.c showing two taskbar panes on Cancel (#3861)

Only show the main dialog pane on taskbar when executing a Cancel dialog.
Assign previous window handle as a parent when creating Cancel dialog box.

CORE-17702
This commit is contained in:
Doug Lyons 2021-07-29 20:56:24 -05:00 committed by Stanislav Motylkov
parent 236649c626
commit 81358d08f0
No known key found for this signature in database
GPG key ID: AFE513258CBA9E92

View file

@ -171,6 +171,10 @@ static const WCHAR szHyperLink[] = {'H','y','p','e','r','L','i','n','k',0};
static DWORD uiThreadId;
static HWND hMsiHiddenWindow;
#ifdef __REACTOS__
static HANDLE hPrevious = NULL;
#endif
static LPWSTR msi_get_window_text( HWND hwnd )
{
UINT sz, r;
@ -3819,6 +3823,9 @@ static LRESULT WINAPI MSIDialog_WndProc( HWND hwnd, UINT msg,
case WM_DESTROY:
dialog->hwnd = NULL;
#ifdef __REACTOS__
hPrevious = NULL;
#endif
return 0;
case WM_NOTIFY:
return msi_dialog_onnotify( dialog, lParam );
@ -3854,15 +3861,26 @@ static UINT dialog_run_message_loop( msi_dialog *dialog )
if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
style |= WS_MINIMIZEBOX;
#ifdef __REACTOS__
hwnd = CreateWindowW( szMsiDialogClass, dialog->name, style,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
hPrevious, 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__
hPrevious = hwnd;
#endif
ShowWindow( hwnd, SW_SHOW );
/* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */