Skip to content

Commit

Permalink
[MSI] Improve previous msi/dialog.c patch to match code committed to …
Browse files Browse the repository at this point in the history
…Wine. (reactos#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 <[email protected]>
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51576
  • Loading branch information
Doug-Lyons authored Dec 29, 2021
1 parent b94b435 commit 00ace73
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions dll/win32/msi/dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
Expand All @@ -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 );
Expand All @@ -3861,26 +3854,18 @@ 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
parent = dialog->parent ? dialog->parent->hwnd : 0;

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 )
{
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 */

Expand Down

0 comments on commit 00ace73

Please sign in to comment.