question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating a TaskbarIcon in-code causes windows to treat each instance as unique

See original GitHub issue

Describe 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

  1. Create a TaskbarIcon manually, using the code described above
  2. Launch the app multiple times
  3. Check “Other system tray icons” in settings

Expected behavior

Only one entry for the application

Screenshots

image

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:closed
  • Created a year ago
  • Comments:17 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
kurmachucommented, Apr 10, 2022

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.

1reaction
HavenDVcommented, Apr 7, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found