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

commit d74ceb655957ede39a4b63084c065e1eaaa905a8
Author:     Raymond Czerny <[email protected]>
AuthorDate: Mon May 9 20:36:23 2022 +0200
Commit:     GitHub <[email protected]>
CommitDate: Mon May 9 21:36:23 2022 +0300

    [SHELL32] Fix visual glitch appeared after fixing CORE-18137 (#4488)
    
    - Check if the parent window of RunDLL is the desktop,
      only in this case add the system control applet to the taskbar.
    - Try loading small 16x16 icon for the taskbar button.
    
    CORE-18175
---
 dll/win32/shell32/wine/control.c | 27 ++++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/dll/win32/shell32/wine/control.c b/dll/win32/shell32/wine/control.c
index 6044b736fdb..6103af4136c 100644
--- a/dll/win32/shell32/wine/control.c
+++ b/dll/win32/shell32/wine/control.c
@@ -819,10 +819,35 @@ Control_EnumWinProc(
 static void
 Control_ShowAppletInTaskbar(CPlApplet* applet, UINT index)
 {
+    HICON hSmallIcon;
     ITaskbarList* pTaskbar = NULL;
 
+    /* Try to add a taskbar button only if the applet's parent window is the 
desktop */
+    if (GetParent(applet->hWnd) != NULL)
+    {
+        return;
+    }
+
     SetWindowTextW(applet->hWnd, applet->info[index].name);
-    SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, 
(LPARAM)applet->info[index].icon);
+
+    /* Try loading the small icon for the taskbar button */
+    hSmallIcon = (HICON)LoadImageW(applet->hModule,
+                                   
MAKEINTRESOURCEW(applet->info[index].idIcon),
+                                   IMAGE_ICON,
+                                   GetSystemMetrics(SM_CXSMICON),
+                                   GetSystemMetrics(SM_CYSMICON),
+                                   0);
+    if (hSmallIcon)
+    {
+        SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon);
+    }
+    else
+    {
+        if (applet->info[index].icon)
+        {
+            SendMessageW(applet->hWnd, WM_SETICON, ICON_SMALL, 
(LPARAM)applet->info[index].icon);
+        }
+    }
 
     /* Add button to the taskbar */
     ShowWindow(applet->hWnd, SW_SHOWMINNOACTIVE);

Reply via email to