0

I'm developing a C++ app in Visual Studio 2022 with a UI (UI library is wxWidgets). I'm trying to figure out how icons work. I gathered from researching that Windows expects a variety of different icons to be packaged with apps for the best UX (see Which icon sizes should my Windows application's icon include?). However I can't seem to find a way to get multiple icons taken into account.

My understanding so far is that all resource related things, including icons, are controlled by Resource.h and <projectName>.rc, both of which are initially provided by the VS template for a C++ App.

I've removed the provided icons (i.e the "normal" and "small" ones) and have instead imported many icons, one for each size, in the Resource View.

Resource View

But regardless of that, always one icon seem to be used at a time.

Checking the contents of <projectName>.rc, I see the following:

.rc excerpt

I also expect the following, in Resource.h, to be relevant:

Resource.h excerpt

It seems that independently of the icon sizes, IDI_ICON1 is used. If it's 16x16, it's upscaled in context that requires it, if it's 256x256, it's downscaled (poorly, somehow ?) when required i.e in almost all contexts.

How should this be done ? Are there resources available on the matter I may have missed ?

Julien BERNARD
  • 653
  • 6
  • 17

1 Answers1

1

You should embed all your ico files with different resolution into one ico file. The ico file is actually a container and can contain multiple images inside.