WM_SETICON does not update taskbar icon in windows 11

Dejan Pecar 11 Reputation points
2022-01-27T10:50:30.78+00:00

When I change the icon of a window with the following code snippet

HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON1));
SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);

then the icon of the window is updated but not the icon of this window in the taskbar of windows 11.
when i do the same thing in windows 10 both icons are updated.

What can I do that the same code is running in window 10 and windows 11 ?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,386 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
7,918 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Reza-Ameri 16,771 Reputation points
    2022-01-27T17:47:04.953+00:00

    Try open start and search for feedback and open the Feedback Hub app and report this issue and explain how to reproduce this issue.

    1 person found this answer helpful.

  2. Dejan Pecar 11 Reputation points
    2022-02-02T09:57:12.93+00:00

    After further investigations we found out that this problem is only reproduceable on virtualized (VMWare) Windows11 machines.
    The problem is either in the RDP client or in VMWare itself.

    1 person found this answer helpful.

  3. Xiaopo Yang - MSFT 11,081 Reputation points Microsoft Vendor
    2022-01-28T01:43:13.917+00:00

    But when I associate a new small icon with a window, It successes(Windows11).