[MSI] Improve previous msi/dialog.c patch to match code committed to Wine. (#4008)

CORE-17702

Only show the main dialog pane in the taskbar when executing a Cancel dialog.
- Improve previous msi/dialog.c patch to match current Wine code.
- Remove #ifdef's for already committed Wine Code.

In effect, importing Wine's commit 4b88e290521ef9fde9290c9bcbae7420966a6f46:
msi: Set dialog as parent in subsequent dialog.
Author: Fabian Maurer <dark.shadow4@web.de>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576
This commit is contained in:
Doug Lyons 2021-12-29 10:06:28 -06:00 committed by GitHub
parent b94b435a11
commit 00ace73316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -171,10 +171,6 @@ 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;
@ -3823,9 +3819,6 @@ 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 );
@ -3848,7 +3841,7 @@ static void process_pending_messages( HWND hdlg )
static UINT dialog_run_message_loop( msi_dialog *dialog )
{
DWORD style;
HWND hwnd;
HWND hwnd, parent;
if( uiThreadId != GetCurrentThreadId() )
return SendMessageW( hMsiHiddenWindow, WM_MSI_DIALOG_CREATE, 0, (LPARAM) dialog );
@ -3861,15 +3854,11 @@ static UINT dialog_run_message_loop( msi_dialog *dialog )
if (dialog->parent == NULL && (dialog->attributes & msidbDialogAttributesMinimize))
style |= WS_MINIMIZEBOX;
#ifdef __REACTOS__
parent = dialog->parent ? dialog->parent->hwnd : 0;
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
parent, NULL, NULL, dialog );
if( !hwnd )
{
@ -3877,10 +3866,6 @@ static UINT dialog_run_message_loop( msi_dialog *dialog )
return ERROR_FUNCTION_FAILED;
}
#ifdef __REACTOS__
hPrevious = hwnd;
#endif
ShowWindow( hwnd, SW_SHOW );
/* UpdateWindow( hwnd ); - and causes the transparent static controls not to paint */