Jump to content
Sign in to follow this  
Squirrely1

Create a ContextMenu for an IE object ?

Recommended Posts

Squirrely1

I have been trying to find a way to use a custom context menu for an IE control. I wasn't able to get the DHTML method "setContextMenu" to work. Does anyone have good documentation on this method? :)

Edit1: All I have been able to find that seems to be of any use is this:

http://msdn.microsoft.com/en-us/library/aa342529(VS.85).aspx

And this snippet of VBScript which isn't working as far as I can tell:

<script language="VBScript" for ="Menu" Event="onclick">
    'define array
    dim menuItems(6) '3 commands 
    'First menu item
    menuItems(0) = "Display the &time" 'Command text
    menuItems(1) = "SetTime"
    'Second menu item
    menuItems(2) = "Display the &date"   'Command text   
    menuItems(3) = "SetDate"
    'Third menu item
    menuItems(4) = "Display the document t&itle" 'Command text
    menuItems(5) = "SetTitle"
    'Assigns the menu to the scriptlet
    window.external.setContextMenu(MenuItems)
</script>

Edit2: After quite a few hours of research into the subject of building a fresh context menu for an IE control, I have concluded that it would be about 30 times easier than using the IDocHostUIHandler::ShowContextMenu method to just build a window using native AutoIt functions that looks and acts like a context menu that follows the mouse, and appears only upon a right-click which I can detect using a javascript.

Edited by Squirrely1

Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.