0
votes

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?

1
This is a defined behavior. Not a bug.kennyzx
I think this has something to do with AppUserModelID. The IsHostApp registry hack ought to be the easiest way to test this. Beware this might be a rabbit hole, I never pin taskbar buttons.Hans Passant
@kennyzx - Ok, it maybe, but a different app of mine, a .NET 4.6.1 C# WinForm program, works "correctly" in both Win7 and Win10, I'm disoriented...Augusto Stefanelli
@HansPassant - Well, i have read the doc on AppUserModelID you linked. I don't use explicit AppUserModelDs in my program so, thinking over System assigned AppUserModelID and .lnk files, I decided to re-create and re-pin to the taskbar the shortcut file to my app. Believe it or not, this works. Maybe I need to recreate shortcut every time i modify and recompile the program...Augusto Stefanelli
Congratulations. Sounds quite plausible, be sure to write your own answer so programmers can find it back.Hans Passant

1 Answers

1
votes

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://docs.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.