icon overlay handlers for namespace extension

随声附和 提交于 2019-12-06 14:50:59

The only way to add an overlay icon is implement IShellIconOverlay in your NSE. But the problem is that IShellIconOverlay.GetOverlayIndex and IShellIconOverlay.GetOverlayIconIndex must return icons received from SHELL image list. Overlay icons from shell image list can be received with SHGetIconOverlayIndex function. And there is NO way to add additional overlay icon into shell image list.

If you want to use standard overlay icons like link or share icons just use SHGetIconOverlayIndex. But if you want to use custom icons you must use "hack". Hack is simple additional overlay shell extension. Only overlay shell extension can add additional overlay icon into shell image list. In IShellIconOverlayIdentifier.GetOverlayInfo you will return your icon and index, IShellIconOverlayIdentifier.IsMemberOf always will return S_FALSE. Inside NSE in IShellIconOverlay_GetOverlayIndex you will call SHGetIconOverlayIndex with your icon and index.

You must use separate overlay shell extension for every icon. But dont forget that Windows has limit of max count of overlay shell extension registered in the system. I dont remember exact number but it is about 15.

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