From d74ceb655957ede39a4b63084c065e1eaaa905a8 Mon Sep 17 00:00:00 2001 From: Raymond Czerny Date: Mon, 9 May 2022 20:36:23 +0200 Subject: [PATCH] [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);