Creating a TaskbarIcon in-code causes windows to treat each instance as unique
See original GitHub issueDescribe the bug
I may be doing something incorrectly, if so feel free to correct me.
I’m creating a new TaskbarIcon
in-code by using
taskbarIcon = new TaskbarIcon();
taskbarIcon.Icon = new System.Drawing.Icon("Assets/(The icon)");
taskbarIcon.ToolTipText = "(tooltip name)";
But this creates a new “unique” icon every time, which floods settings and doesn’t let the user choose if the icon should be in the overflow menu or not.
Steps to reproduce the bug
- Create a
TaskbarIcon
manually, using the code described above - Launch the app multiple times
- Check “Other system tray icons” in settings
Expected behavior
Only one entry for the application
Screenshots
NuGet package version
2.0.24
Platform
WinUI
IDE
Visual Studio 2022
Additional context
I may be doing something wrong, or creating a TaskbarIcon
in-code may be fully unsupported.
It is quite possible there’s simply some ID property or something I’m not aware I need to set.
Issue Analytics
- State:
- Created a year ago
- Comments:17 (10 by maintainers)
Top Results From Across the Web
Win 10 Taskbar one icon for each instance of app. Prefer a ...
I'd prefer a single icon with the number of instances in parentheses to show how many instances. This thread is locked.
Read more >Some taskbar pinned icons are duplicated when an ...
If the first reason is the case then here is a temporary solution. Open up the program, so that you have duplicate icons....
Read more >[ Question] How to set Taskbar Icon · Issue #2722
ico in the window/tray icon. I tried varying sizes 16x16, 26x26, 50x50, 250x250. What do I need to set/change for "application icon" or...
Read more >Clicking on taskbar icon now switches windows instead of ...
To revert to the previous settings, right-click on the taskbar and choose "Configure taskbar with symbols". Then, go to the tab "Behavior" ...
Read more >How to Group Taskbar Icons in Windows 10 [Tutorial] - YouTube
You can make the taskbar look how you want, manage your calendar, ... In Windows 10, when you open multiple instances of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This may also be a Windows 11 bug which Microsoft needs to fix.
I recommend making another issue to track this if you would like; you may feel free to use my recording in it if you do so.
Yes of course. The main problem I want to solve is so that the user does not have to set a fixed GUID on a permanent basis (but with such an option if necessary). I need to check if
Assembly.GetEntryAssembly()
returns the same Guid for the same application and different for different applications so that I can use this as the default behavior.