怎样在IE的右键菜单中建子菜单?

maix 2005-01-07 08:50:21
象Flashget那样,可以在HKEY_CURRENT_USER\Software\Microsoft\Internet
Explorer\MenuExt\下添加一项,使得IE右键增加一项,但是我如果想先添加一个子菜单,再添加我的项,怎么实现呢?
...全文
303 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
YHW 2005-01-09
  • 打赏
  • 举报
回复
倒,你照他的做,如果在没安装那个软件的机器上是不会出来的。楼主太粗心。
maix 2005-01-07
  • 打赏
  • 举报
回复
二楼的兄弟,我下了那个软件,它确实可以做到。我搜索了注册表,并按它的做了,确实可以增加子菜单,问题已经解决,给分。另外jiangsheng提示的用com做,也给了我很多启发,也给分。谢谢大家!
蒋晟 2005-01-07
  • 打赏
  • 举报
回复
http://www.pcmag.com/article2/0,1759,1166596,00.asp

You can choose between two strategies. The first approach is to declare your menu entries in the Registry, under the key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt. This process is described in the MSDN Library (article Q177241). This was the wrong choice for Web Highlighter for two main reasons: First, these menu items can only point to executables or scripts, making communication with the BHO module very difficult. Second, the menu commands cannot be updated (for example, grayed or checked) to reflect current settings.


The second approach is to implement the IDocHostUIHandler interface in the BHO and use ICustomDoc::SetUIHandler to notify Internet Explorer that the program will display the context menu itself. IDocHostUIHandler::ShowContextMenu is the method used to modify the way the standard context menu is displayed. Unfortunately, Internet Explorer doesn't let you add your own menu items to the existing menu. Either you let Internet Explorer display its own menu, or you replace it completely. There are no other options!

The solution is awkward, but there was no other choice. Web Highlighter must build a context menu that is a replica of the standard Internet Explorer context menu and then add its own commands to this menu. To do this, Web Highlighter retrieves the IE menu from the resources contained in Shdoclc.dll (this is where the various flavors of the standard context menus reside), selects the relevant menu according to the context, and then adds its own commands. The code of IDocHostUIHandler::ShowContextMenu contains all the details.

Note that when the replacement context menu is activated, the Internet Explorer window procedure recognizes its own menu items when receiving the WM_INITMENUPOPUP message and updates them according to the context (for example, checking an item or graying it). But any command that is not recognized by Internet Explorer is disabled. This is a very strange and unfriendly way of handling extensions to the WebBrowser control.

Again, the workaround is awkward, but there is no other solution: Before calling TrackPopupMenu to display the context menu, Web Highlighter subclasses the Internet Explorer window temporarily and handles the WM_INITMENUPOPUP message in a custom routine, where Web Highlighter updates its own menu items. Immediately after the pop-up menu closes, the original window procedure is restored.

see also
http://blog.csdn.net/jiangsheng/archive/2004/11/07/170742.aspx
maix 2005-01-07
  • 打赏
  • 举报
回复
我因为做了一组COM想放在IE右键上,因为是一组的,所以想放在一个子菜单上,就像IE右键的“编码”一样,但是找了很久也没发现有这方面的文章,基本上都是讲怎么添加一个子项的,没有添加菜单的。
maix 2005-01-07
  • 打赏
  • 举报
回复
看了,可是只能添加项,不能添加子菜单,然后再添加项,就像你在IE中点鼠标右键时出现的“编码”一样,用这个键值做不到,我试过了。另外二楼说的那个软件我看了,我先下来研究一下。
Kudeet 2005-01-07
  • 打赏
  • 举报
回复
http://search.csdn.net/Expert/topic/1123/1123054.xml?temp=.7210504
http://search.csdn.net/Expert/topic/1180/1180240.xml?temp=.806698
Kudeet 2005-01-07
  • 打赏
  • 举报
回复
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt
HOWTO: Adding to the Standard Context Menus of the WebBrowser Control
Article ID:Q177241
YHW 2005-01-07
  • 打赏
  • 举报
回复
http://www.goupsoft.com/ezsaveflash
这个软件实现了.

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧