Change taskbar icon at runtime on deployed app
See original GitHub issueI would like to change taskbar icon to identity what type the current app is, so I set a default icon for the app and the icon will be changed according to the type returned from server when the app is launching.
I just change the icon like this:
Application.Current.MainWindow.Icon = new BitmapImage(new Uri(string.Format("AppLogos/{0}.ico", terminal.TerminalType.Name), UriKind.Relative));
It’s working well on Visual Studio but I found out that it’s not changing my task bar on deployed app (Install the app using a MSI file).
So is there a way to do it?
UPDATE
To force the icon refresh on my deployed app I have to pin/unpin my icon taskbar, unfortunately this is a user command only so I can’t do this in wpf programmatically.
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (5 by maintainers)
Top Results From Across the Web
Change taskbar icon at runtime on deployed app
In your project expand the Properties and doubleclick Resources.resx then you can hit Add Resource -> Add Existing File and add your Icons....
Read more >[Solved] Change icon displayed in taskbar at runtime
In code I am simply changing the Form.Icon property and this works no problem if I run the app from the EXE. The...
Read more >How to change the app icon displayed at the windows ...
How to change the app icon displayed at the windows taskbar during runtime? If this is your first visit, be sure to check...
Read more >how to change compiled app icon (using app designer) on ...
I have MatLab ver 2021b. You can change the default ICON like shown in this picture.
Read more >How to change taskbar icon during runtime on windows
Hi all, I've created a Qt application to talk with a remote device and I want to change the taskbar icon to show...
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 FreeTop 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
Top GitHub Comments
I think that it is a bug. I tried @musli’s idea, creating a runner.exe that runs the real application. As of now, changing the application icon in the taskbar under the following conditions has worked.
But now it gets interesting: If I pin the original exe in addition to the pinned runner.exe in the startup, then the change of the application icon in the taskbar does not work anymore.
So, in my opinion, the problem is related to Windows’ own shortcut management.
@563203132 @lindexi Maybe there’s a problem with your packaging, and I created a wix SetupProject that uses it to compile a .msi installation package, and the program that runs out doesn’t have that problem There’s also a small finding that your problem won’t exist when the taskbar doesn’t merge icons (from Quicker of master) Demo.zip