How to install an icon in a Windows application using Visual Studio

I want to add an icon to my application. I have added an icon resource. and its working file for the first icon. This means that after compilation, the 16x16 icon of the exe file will be the same as the icon file. but when the explorer window is enlarged to a large icon size, the exe file icon will disappear and another empty default icon will appear.

How to set the icon for both large and small size?

+4
source share
1 answer

From your comments, it looks like you have several icon files installed for your project. It will not work the way you want, or at least it is a really difficult way to do it.

An easy way is to let the operating system handle this for you. Create a single icon file that contains several icon sizes. 16x16, 32x32, 48x48 and 256x256 are the minimum sizes required for current versions of Windows, but you can certainly add more (for example, 24x24 or 128x128) to improve pixel accuracy at these sizes, if necessary.

You can use Visual Studio to create icons. Opening the .ico file should automatically open the icon resource editor. But I personally find it difficult or cumbersome to use. I highly recommend using a third-party program like IcoFX to create icons and click pixels around.

+4
source

Source: https://habr.com/ru/post/1396486/


All Articles