vennag

Hi

Any give me the idea how to add my own menu to IE context menu

Whenever user right clicks on a link my menu should be display like [download using VS]

using my own menu i have to pass url or parameters to my exe

thanks




Re: Internet Explorer Extension Development how to add my own menu to IE context menu

John Sudds - MSFT

Adding Entries to the Standard Context Menu

http://msdn2.microsoft.com/en-us/library/aa753589.aspx

The technique works great for script files that access content of the main page through the window.external object.

Register your menu item as a new key under: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt

Set the (Default) value to the full path of the script file, and set "Contexts" (DWORD) = 0x20.

In your script file, the event object indicates the DOM element that was clicked.

<script type="text/javascript">
var win = window.external.menuArguments;
alert(win.event.srcElement.href);
</script>






Re: Internet Explorer Extension Development how to add my own menu to IE context menu

srinivas

its working fine with js file but

how can i pass
Arguments to my c# exe file

thanks







Re: Internet Explorer Extension Development how to add my own menu to IE context menu

John Sudds - MSFT

Unlike script running in the browser, a context menu extension is not locked into the Local Machine Zone. So, you can create any ActiveX objects that you require for your task. The WScript Host provides the easiest way to launch an application.

<script type="text/javascript">
var win = window.external.menuArguments;
var arg = win.event.srcElement.href;
var wsh = new ActiveXObject("WScript.Shell")
wsh.run(arg);
// var myExe = "C:\\Full\\Path\\To.exe "; /* plus space */
// wsh.run(myExe + arg);
</script>

WScript.Shell.Run uses ShellExecute to launch the associated application. (The example above opens the default browser.)






Re: Internet Explorer Extension Development how to add my own menu to IE context menu

srinivas

thanks






Re: Internet Explorer Extension Development how to add my own menu to IE context menu

bala nagaraj

Hi,

I have same requirement,I already did creating menu for selected text on IE,it's working,Then how is pass the arguments to C# EXE,Can you give the detailed explanation.

Advance in Thanks

Bala Nagaraj






Re: Internet Explorer Extension Development how to add my own menu to IE context menu

IECUSTOMIZER

IE Button script to open the current location in Firefox (for developers to test their site for cross browser compatibility)

<script language="javascript">
// Open this location in FireFox
var sURL = window.external.menuArguments.location;
var WshShell=new ActiveXObject("wscript.shell")
WshShell.run("FireFox " + sURL)
</script>

Download from http://www.iecustomizer.com/ url=iebuttons/ txtProvider=127

<script language="javascript">
// Open this location in Netscape
var sURL = window.external.menuArguments.location;
var WshShell=new ActiveXObject("wscript.shell")
WshShell.run("Netscape " + sURL)
</script>

Download from http://www.iecustomizer.com/ url=iebuttons/ txtProvider=128