本文介绍了C ++:第1步:ExtractIconEx。第2步: ???步骤3:SetMenuItemBitmaps的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试向shell扩展添加图标。我有这个代码(清理为容易阅读),其工作原理:
I'm experimenting with adding icons to a shell extension. I have this code (sanitized for easy reading), which works:
InsertMenu(hmenu, index, MF_POPUP|MF_BYPOSITION, (UINT)hParentMenu, namestring);下一步是这个代码:
HICON hIconLarge, hIconSmall; ICONINFO oIconInfo; ExtractIconEx("c:\\progra~1\\winzip\\winzip32.exe", 0, &hIconLarge, &hIconSmall, 1); GetIconInfo(hIconSmall, &oIconInfo); //??????? SetMenuItemBitmaps(hParentMenu, indexMenu-1, MF_BITMAP | MF_BYPOSITION, hbmp, hbmp);我用什么来替换?尝试谷歌这种知识发现了许多提示,我没能成功。
What do I put in to replace the ?'s. Attempts to Google this knowledge have found many tips that I failed to get working. Any advice on getting this to work, especially on older machines (e.g. no framework, no vista) is appreciated.
推荐答案任何建议,让它工作,特别是在旧机器上(例如没有框架,没有vista)虽然背景颜色是黑色的而不是透明的,但是工作正常。
This works, though the back color is black instead of transparent.
GetIconInfo(hIconSmall, &oIconInfo); SetMenuItemBitmaps(hmenu, uMenuIndex+i+popUpMenuCount-1, MF_BITMAP | MF_BYPOSITION, oIconInfo.hbmColor, oIconInfo.hbmColor);更多推荐
C ++:第1步:ExtractIconEx。第2步: ???步骤3:SetMenuItemBitmaps
发布评论