Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change pinned taskbar icon (windows 7)

I wan't to customize the icon displayed within the windows 7 taskbar. When my app is running, I can do it by changing main window icon but, when the app is pinned, the exe's icon is displayed.

How can I set the taskbar icon for my app to an icon different from the one embedded within the exe ?

Not tried, this solution may work but looks dirty.


Edit :

Our app is compiled once but depending on config file, features are enabled or not so it's a product or another. We do not want to compile one exe for each product.

The solution above may not work as many instances of my app can be installed in different pathes (so you end up with the same exe file name but different icons!), is this registry key poorly designed or am I missing something?

like image 792
François Avatar asked Jun 09 '09 09:06

François


People also ask

How do I change the icon on a pinned taskbar?

Alternatively, if you hold Shift and right-click the icon on the taskbar, you get the standard Windows Explorer context menu, instead of the application jump list. Again, click Properties. From the Properties dialog, go to the Shortcut tab and click the Change Icon button. Select a new icon file by clicking Browse.

How do I unpin icons from the taskbar in Windows 7?

To remove a program pinned to the taskbar, first right-click on the program's icon in the taskbar. In the context menu that appears, select Unpin this program from taskbar. The program will vanish from the taskbar.

Where are pinned taskbar items stored in Windows 7?

Pinned items on the taskbar are stored in your user account folder.


1 Answers

EDIT The info below is a bit obsolete; all new Windows 7 bits are now available as a managed API, available here: http://code.msdn.microsoft.com/WindowsAPICodePack

There is a series of articles on the new Taskbar API by the debugging guru Sasha Goldshtein. You should have a look at the Overlay Icons and Progress Bars API.

You can download the sample code from Windows 7 Taskbar Developer Resources on Microsoft Code. What you're looking for is the IMClient sample:

The IMClient sample demonstrates how taskbar overlay icons and taskbar progress bars can light up an application’s taskbar button instead of relying on an additional dialog or on an icon in the system notification area (tray).

alt text
(source: microsoft.co.il)

alt text
(source: microsoft.co.il)

alt text
(source: microsoft.co.il)

I believe this should help you achieve what you want.

like image 56
Igal Tabachnik Avatar answered Oct 03 '22 01:10

Igal Tabachnik