How to resize Windows Icon Overlay?
Asked Answered
G

1

6

I made a icon overlay to my file, *.myfile, but the overlay size is wrong. When the icon shows in size 16x16, the overlay covers the icon.

How can I change the overlay size? (IShellIconOverlayIdentifier)

left is mine, right is tortoisesvn

Gayla answered 18/1, 2012 at 7:28 Comment(5)
Resize it in your icon editorStuyvesant
What size is the icon in the icon file that you created?Cudweed
32x32, it's not very clear when i choose to show the biggest iconGayla
Did you call LoadIcon? That API gives you no control over the size you load.Stuyvesant
@DavidHeffernan no, there is no such thing in IShellIconOverlayIdentifier members. And no place(that interface) to set or return "Icon Type" too.Gayla
C
6

You can't change the overlay size. Instead use a multi-resolution icon file where all necessary sizes are available.

For a good example take a look into the source of TortoiseSVN. Their will be only one icon file used, but if you open it with an appropiate paint tool, you'll see that this file contains different sizes.

Update

If you take a look right at the first method, you'll get the following comment:

"The Shell calls IShellIconOverlayIdentifier::GetOverlayInfo to request the location of the handler's icon overlay. The icon overlay handler returns the name of the file containing the overlay image, and its index within that file. The Shell then adds the icon overlay to the system image list."

You can see in line 129 that it tries to find out the path of the needed file from the registry. By browsing the code you can find the icons in subversion here. In line 165 you can see that it takes the filename from the registry and writes it back to its out parameters and maybe the magic flag to let windows decide which size should be taken from the file is *pdwFlags = ISIOI_ICONFILE;.

Concentrated answered 18/1, 2012 at 8:9 Comment(3)
Presumably at runtime the icon is in an icon group resource? And what sizes are required by Windows?Stuyvesant
@Concentrated er... how? You mean an image file contains several images in that? But howto decide which one to show? I'm looking the source, but i couldn't find the code and image(you said) in the TortoiseSVN source.Gayla
Thanks, this is helpful "multi-resolution icon file."Gayla

© 2022 - 2024 — McMap. All rights reserved.