Hi @Lena🌺 🏳️⚧️ ,
Thanks for reaching out.
Windows does not support showing a shortcut’s icon in the taskbar for a running Win32 application. This is expected behavior by design: when an application starts, the taskbar button always represents the actual running process, and Windows uses the icon tied to the application’s executable identity - not the .lnk shortcut used to launch it.
Microsoft documents this behavior in the Application User Model (AppUserModel) guidelines, which explain that the taskbar uses the AppUserModelID (AUMID) or, if none is set, the executable path to determine icon, grouping, and identity:
- AppUserModelID behavior (taskbar identity & grouping) https://learn.microsoft.com/en-us/windows/win32/shell/appids
- Taskbar (Win32) overview https://learn.microsoft.com/en-us/windows/win32/shell/taskbar
- Set a custom icon for taskbar using AppUserModelID https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchiconresource
Because the taskbar icon is bound to the running process identity, Windows ignores any custom icon defined in the .lnk file once the application starts.
If you need a custom icon to appear on the taskbar, the supported methods are:
- Assign a custom AppUserModelID and associate an icon with that AUMID This allows Windows to use your chosen icon for the taskbar entry. (https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchiconresource)
- Modify the EXE’s embedded icon Editing the application’s resources changes both the file icon and the taskbar icon.
There is no setting or API in Windows that can force the taskbar to display a shortcut’s icon instead of the executable’s icon.
Hope this helps! If my answer was helpful - kindly follow the instructions here so others with the same problem can benefit as well.