https://git.reactos.org/?p=reactos.git;a=commitdiff;h=81358d08f0865224a11194909a84ae8fa0b10c40

commit 81358d08f0865224a11194909a84ae8fa0b10c40
Author:     Doug Lyons <dougly...@douglyons.com>
AuthorDate: Thu Jul 29 20:56:24 2021 -0500
Commit:     Stanislav Motylkov <x86co...@gmail.com>
CommitDate: Fri Sep 3 22:54:22 2021 +0300

    [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
---
 dll/win32/msi/dialog.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/dll/win32/msi/dialog.c b/dll/win32/msi/dialog.c
index 7a8417ff70c..01da9e048ff 100644
--- a/dll/win32/msi/dialog.c
+++ b/dll/win32/msi/dialog.c
@@ -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 */
 

Reply via email to