https://git.reactos.org/?p=reactos.git;a=commitdiff;h=484943d04f0dc3f84b7c8…
commit 484943d04f0dc3f84b7c8e754d1d2505f0a41df3
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Jan 24 22:41:42 2019 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Jan 24 22:41:42 2019 +0900
[USER32] Make App Switcher use the owner window's icon (#1299)
CORE-15672
---
win32ss/user/user32/controls/appswitch.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/win32ss/user/user32/controls/appswitch.c
b/win32ss/user/user32/controls/appswitch.c
index 7f97d0dfac..ecd48b47e7 100644
--- a/win32ss/user/user32/controls/appswitch.c
+++ b/win32ss/user/user32/controls/appswitch.c
@@ -165,20 +165,24 @@ void CompleteSwitch(BOOL doSwitch)
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
{
HICON hIcon;
+ HWND hwndIcon, hwndOwner;
UNREFERENCED_PARAMETER(lParam);
+ hwndOwner = GetWindow(window, GW_OWNER);
+ hwndIcon = (hwndOwner ? hwndOwner : window);
+
// First try to get the big icon assigned to the window
- hIcon = (HICON)SendMessageW(window, WM_GETICON, ICON_BIG, 0);
+ hIcon = (HICON)SendMessageW(hwndIcon, WM_GETICON, ICON_BIG, 0);
if (!hIcon)
{
// If no icon is assigned, try to get the icon assigned to the windows' class
- hIcon = (HICON)GetClassLongPtrW(window, GCL_HICON);
+ hIcon = (HICON)GetClassLongPtrW(hwndIcon, GCL_HICON);
if (!hIcon)
{
// If we still don't have an icon, see if we can do with the small icon,
// or a default application icon
- hIcon = (HICON)SendMessageW(window, WM_GETICON, ICON_SMALL2, 0);
+ hIcon = (HICON)SendMessageW(hwndIcon, WM_GETICON, ICON_SMALL2, 0);
if (!hIcon)
{
// using windows logo icon as default