C # console application. When it starts with Windows, it has no icon

Okay, so this is what I did.

I created a console application in C #. I gave him the application icon in the properties sheet of my .csproj. I build. I am running. This is just great. The taskbar icon is just fine. When I press Alt + Tab to switch windows, the icon is also displayed there.

I added a registry entry to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run so that the console application starts with Windows. When the same application starts with Windows, it has a standard default console application icon. If I close the application and restart it manually, the correct icon will appear on the taskbar.

What a deal?

C #,. Net 4.5, 64-bit version of Windows 7 Professional

+4
source share
1 answer

First, you should notice that the Windows icons come in 4 standard sizes: 16x16, 32x32, 48x48, and 256x256. Any .ico file that you use for the icon of your application must have a complete set of 4 in it.

Another possibility is that sometimes the icon cache in Windows does not sync with the actual application icon. It is perhaps more likely that updating the application icon several times will cause this. You might want to try the following instructions to clear the Windows icon cache and allow it to be rebuilt:

http://www.thewindowsclub.com/rebuild-the-icon-cache-windows

0
source

All Articles