How to resize Windows Icon Overlay icon?

I overlaid the icon on my file, *.myfile , but the size of the overlay is incorrect. When the icon shows a 16x16 size, the overlay closes the icon.

How to change the size of the overlay? ( IShellIconOverlayIdentifier )

left is mine, right is tortoisesvn

+6
source share
1 answer

You cannot resize the overlay. Instead, use the icon file with several permissions , where all necessary sizes are available.

For a good example, consider the source of TortoiseSVN . There will be only one icon file, but if you open it with a suitable drawing tool, you will see that this file contains different sizes.

Update

If you look directly at the first method, you will get the following comment:

"The shell calls IShellIconOverlayIdentifier :: GetOverlayInfo to request the location of the handler icon overlay. The icon overlay handler returns the name of the file containing the overlay image and its index inside this file. The shell then adds the icon overlay to the list of system images.

On line 129 you can see that it is trying to find the path to the desired file from the registry. After looking at the code, you can find the badges in the subversion here . On line 165 you can see that it takes the file name from the registry and writes it back to its parameters and, possibly, a magic flag so that the windows decide what size should be taken from the file, *pdwFlags = ISIOI_ICONFILE; .

+6
source

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


All Articles