lahsrah
lahsrah

Reputation: 9173

Winforms: How to change application taskbar icon programatically for Pinned App in Windows 7

I am changing the icon by doing the following in the Main form:

 this.Icon = myIcon; 

And this works fine in Windows 7 except when I "pin" the application to the taskbar, this seems to have no effect on the taskbar icon and only affects the top/left of the window icon.

How do I ensure that I can change the application taskbar icon as well in Windows 7 without having to use Windows 7 Icon overlays as that will just be overlaying another graphic on the icon but not changing the main icon?

Upvotes: 3

Views: 4523

Answers (1)

lahsrah
lahsrah

Reputation: 9173

Pinned app actually creates a windows shortcut. So to do this will have to manipulate a windows shortcut file on disk. Not a good idea as it seems hacky. Decided to use overlays instead.

Upvotes: 1

Related Questions