Change the Visual Studio taskbar icon from extension

83 Views Asked by At

TL;DR - I am attempting to set the Visual Studio taskbar icon from within a Visual Studio extension, but cannot get the icon to update.

For context, I am forking a VS extension that adjusts the colours of various bits of the UI based on the current solution file and wanted to add functionality to update the icon too. I've had success already adding an overlay icon to the taskbar; this can be done simply by modifying the Window.TaskbarItemInfo.ThumbButtonInfos collection.

From what I can see, it should be possible to set the icon of a WPF application like Visual Studio by simply setting Window.Icon, and I have confirmed this works for a misc WPF project. In the VS extension, this property is accessible and I can set it's value, but the icon never updates in the taskbar. Am I missing some sort of refresh / redraw call, or is this not something that VS extensions are allowed to do, and it's being reset somewhere else? I'm sure that the image file is being loaded correctly, as it works when setting the ThumbButtonInfo icon.

If anyone fancies digging deeper, you can find the project here and the exact line here.

Cheers.

0

There are 0 best solutions below