Search code examples
c#taskbar

c# running application icon duplicates on taskbar instead of highlight shortcut


I've a .NET 4.0 C# WinForm application and the related shortcut placed on taskbar. In Windows 7, after application starts, the icon of the shortcut in taskbar is "highlighted" as i expect. Differently, in Windows 10, after program starts, a second app icon appears on the taskbar as the rightmost one, and the shortcut icon remains without "highlight". Someone may help me?


Solution

  • I've solved this issue re-creating and re-pinning to the Win10 taskbar the shortcut (.lnk) to the application.

    As Hans Passant (thanks Hans) pointed out in comments to the question, this may be a behaviour related to the system-assigned AppUserModelIDs. Read https://learn.microsoft.com/en-us/windows/desktop/shell/appids for complete infos.

    Maybe you need to re-create shortcut any time you modify and recompile your app.