How to resize Windows Icon Overlay?

偶尔善良 提交于 2019-11-30 04:44:11

问题


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)


回答1:


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;.



来源:https://stackoverflow.com/questions/8906619/how-to-resize-windows-icon-overlay

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!