Change app icon: Works in title bar, but not in TaskBar or Start menu

I wrote a program in Visual C # 2010 on Windows7 and I want to change the icon it displays in the Start Menu and Taskbar.

I changed the icon to what I want in three different places: in the property list of the main form in the form designer; in the NotifyIcon that I added to the project; and on the project properties page, under the icon and manifest entry in the Application section.

As a result, I have the correct icon in the title bar of the application, as well as in the taskbar and in the app launcher icon array that appear when Alt-Tab is pressed. But I still have the wrong icon in the start menu (I just dragged the executable to the start menu to put it there) and on the taskbar. What's weird is when I hover over the (wrong) icon in the taskbar, the correct icon appears below it along with the app title.

Can anyone tell me what else I need to change so that ALL the icons displayed are the ones I need?

Related question: Also in the start menu, the name appears as the default "WindowsFormsApplication1", although I've also changed it everywhere I can think of, including all project directories and namespaces. I can rename it easily in the start menu, but I would like it to be right when I dragged it there.

Any help on any of these issues was greatly appreciated.

Edit: On my screen, at least my comment responses are hidden, so I'll add them here:

1) I am not deploying this yet, I just run it either from the VC # IDE or by clicking the exe file generated by the VC #.

2) I didn't add the app to the taskbar. I'm talking about an icon that only appears on the taskbar when the application starts.

3) I didn't see anything about sizing in any of the three places I mentioned where I changed the icons.

4) How to update the icon in exe?

5) the problem persists even if I shut down and restart my computer completely.

Thanks to all who responded.

Edit 2: Also forgot to add that the correct icon appears next to the file name in Windows Explorer.


source to share

4 answers

Just post this comment from Hans Passat as an answer for more visibility here.

The Windows shell hides the icons that are used in the taskbar, so even after making changes to the .NET project and redeploying the application, you may still see the old (or standard) icon in the taskbar. The solution is to navigate to the C: \ Users \ usernamehere \ AppData \ Local folder and rename the IconCache.db file to something else like IconCache.old.db.

Then log out and log back in.

This should fix the problem and you should now see the new icons in the taskbar.



The icons on the taskbar (if pinned) and the Start menu are part of the shortcut that is created when you first type. You will have to delete and recreate them. They do not dynamically reflect changes to the app icon.



Taking the most radical approach, I started a new project, copied all the cs files from the old project, and set all the icons to what I wanted before doing the build. It worked; all icons are correct and the name on the start menu is correct.

But of course there is a way to change them after the initial build ???



You will need to change the shortcut icon in the app. The start menu and taskbar use a shortcut icon.

Alternatively, you can also use WM_SETICON to set an icon that will override the shortcut icon.



All Articles