mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[USER32] Make App Switcher use the owner window's icon (#1299)
CORE-15672
This commit is contained in:
parent
a024ae626f
commit
484943d04f
1 changed files with 7 additions and 3 deletions
|
@ -165,20 +165,24 @@ void CompleteSwitch(BOOL doSwitch)
|
||||||
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
BOOL CALLBACK EnumerateCallback(HWND window, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HICON hIcon;
|
HICON hIcon;
|
||||||
|
HWND hwndIcon, hwndOwner;
|
||||||
|
|
||||||
UNREFERENCED_PARAMETER(lParam);
|
UNREFERENCED_PARAMETER(lParam);
|
||||||
|
|
||||||
|
hwndOwner = GetWindow(window, GW_OWNER);
|
||||||
|
hwndIcon = (hwndOwner ? hwndOwner : window);
|
||||||
|
|
||||||
// First try to get the big icon assigned to the 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 (!hIcon)
|
||||||
{
|
{
|
||||||
// If no icon is assigned, try to get the icon assigned to the windows' class
|
// 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 (!hIcon)
|
||||||
{
|
{
|
||||||
// If we still don't have an icon, see if we can do with the small icon,
|
// If we still don't have an icon, see if we can do with the small icon,
|
||||||
// or a default application 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)
|
if (!hIcon)
|
||||||
{
|
{
|
||||||
// using windows logo icon as default
|
// using windows logo icon as default
|
||||||
|
|
Loading…
Reference in a new issue