CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003

    Adding my own item to the IE context menu

    Im looking for information about how can i do it.
    It involving getting the text under the cursor.
    which ( the text ) can by either text or link.
    by seleting the item i what to add, i need to recognize the text
    and launch my app ( which is just a service / windowless app )\
    and do what i need to do.
    the text / link will be usually a 5-6 digit number.

    Thanks in advance for any help.

  2. #2
    Join Date
    May 2000
    See this article from MSDN:
    Adding Entries to the Standard Context Menu

  3. #3
    Join Date
    Dec 2003
    Thanks you very very much,
    very helpfull.

    but, forgive a dumb man.
    it is not working

    i followed the steps as i understand it.

    HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\<Menu Text>

    1. i didnt find any MenuExt key.
    so i'v created one

    2. as i understand, the <Menu text> is a key too.
    am i right?????

    3. The next steps are not quite clear to me.
    can you explain please???

    Thanks again,

  4. #4
    Join Date
    May 2000
    Actually there are 2 ways to add a menu item into default Internet Explorer context menu.

    1. First is writing ActiveX, which implements IDocHostUIHandler::ShowContextMenu method.
    IDocHostUIHandler::ShowContextMenu will be called every time, when Internet Explorer wants to display a context menu.
    Returning E_NOTIMPL or S_FALSE from this method indicates to the WebBrowser Control that it should display its own standard context menu. However, returning S_OK causes the WebBrowser Control not to display its menus. So you can create your own context menu, then add WebBrowser's default context menu items and finally add your own menu item into newly created context menu.

    2. The second way is using "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt" registry key.
    Originally posted by Stam1
    2. as i understand, the <Menu text> is a key too.
    am i right?????
    Yes you are right. You need to create "Menu text" key under
    "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt".
    If, for example, you will create following key:
    "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\My Text".
    The "My Text" will be displayed in the context menu.
    But you need also create the REG_DWORD type key named "contexts" with values as described in mentioned article.
    This values will ask to your WebBrowser in wich cases show your new menu item. There is some kind of context menus of IE:
    the context menu, which displayed when user right clicks on some image, the context menu, which diplayed when user right clicks on the tables, on the texts and so on.
    So you need to provide this information to Internet Explorer by setting corresponding bits in "contexts" DWORD value.
    The next important thing is your "My Text" key's "Default" key value, where you need to provide some URL to HTML file.
    The script, contained in that HTML file will run, when user click on your added context menu item.
    See following MSDN article for more details:

    HOWTO: Adding to the Standard Context Menus of the WebBrowser Control

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.