What Executable Icons/Thumbnails are Chosen by Windows?

153 views Asked by At

The Visual compilers and GCC use .rc files to add resources to your executable. One can specify a resource type called ICON, to add an Icon to your executable. If I specify multiple ICONs in my .rc files, which one is chosen to be displayed as a thumbnail in the Windows explorer and which one is chosen to be displayed as the window icon, when the programm starts?

I conducted a few tests and it seems, that it allways chooses the same one to be displayed in the Windows Explorer as a thumbnail, but perhaps this is some caching done by windows. The Properties window from the Windows Explorer allways shows a different icon, perhaps one with the smallest size. The icon beeing displayed, when the program is executed differes (it might be the one, with the lowest value, described by nameID in the docs).

The official Windows docs do not answer this question: https://learn.microsoft.com/en-us/windows/win32/menurc/icon-resource. I don't think there are any docs about this from gcc/windres specifically.

By the way, even though the docs clearly say...

Defines a bitmap that defines the shape of the icon to be used for a given application or an animated icon.

...using a bmp file (exported by Windows Paint) is not accepted as an icon by windres (windres: icon file 'bmpicon.bmp' does not contain icon data).

I use gcc, as well as windres to compile the program, but I hope it wouldn't change the outcome, if I used the Visual compilers from Microsoft. In case it was still unclear: Windows is the operating system used.

I am unsure, if this is the correct forum to post such a question, but in case it isn't, I apologize. Thanks in Advance for sharing hard to find information.

0

There are 0 answers