programing Internet Explorer
-
Hi all, i am looking a way to do this: when the explorer runs and the current page have a link inside it, i want to add a new item in the menu that opens when you right-click that link. so when i will right-click a link on the explorer, i will have a new option there that will cause my function to run. also i need to be able to get the current URL and the current document. any ideas? Thanks alot, Ran.Z R.Z
-
Hi all, i am looking a way to do this: when the explorer runs and the current page have a link inside it, i want to add a new item in the menu that opens when you right-click that link. so when i will right-click a link on the explorer, i will have a new option there that will cause my function to run. also i need to be able to get the current URL and the current document. any ideas? Thanks alot, Ran.Z R.Z
You might want to take a look at this[^] article from MSDN. You will need to use
0x20
as the value of yourContexts
registry key so that it only works on links. Once you've added the necessary registry keys, you're going to need to write a script that loads your C# application and passes it the information about the link clicked (take a look at number 2 of the "Implementation Steps" section of the link above for some links about writing this script). Hope this helps :) Cheers, Will H -
You might want to take a look at this[^] article from MSDN. You will need to use
0x20
as the value of yourContexts
registry key so that it only works on links. Once you've added the necessary registry keys, you're going to need to write a script that loads your C# application and passes it the information about the link clicked (take a look at number 2 of the "Implementation Steps" section of the link above for some links about writing this script). Hope this helps :) Cheers, Will HHi sorry for the late reply but it took sometime for me to test it. i managed to create and run a script that knows the URL new shortcut (its great!) but since i'm so bad in javascript , i dont know how to execute my EXE (c#) with that parameter(url shortcut). how can i do it? Thanks alot, Ran Z. R.Z
-
Hi sorry for the late reply but it took sometime for me to test it. i managed to create and run a script that knows the URL new shortcut (its great!) but since i'm so bad in javascript , i dont know how to execute my EXE (c#) with that parameter(url shortcut). how can i do it? Thanks alot, Ran Z. R.Z
I'm sorry but I have no experience with JavaScript at all. It seems to be quite difficult to launch an external program from a script though, for security reasons. I did, however, find this[^] discussion. There is one part that may interest you:
IF you have access to each client to add a regsitry key you can do what you want seamlessly ...
To execute c:\my prog\prog.exe %a %b %cAdd to a new key to HKEY_CLASSES_ROOT called 'myprog'
Add an empty string to this key called 'URL Protocol'
Add the sub-keys: \shell\open\command
Set the value of the default string inside the command key to: "c:\my prog\prog.exe %1"On your web page have your link as:
<A HREF="myprog: %a %b %c">run myprog</A>(%a, %b and %c are arguments i think). I know you are doing this from a script, but you can probably do some sort of redirect to call the link. I have no idea, but
location.href= "myprog: %a %b %c";
might work. Maybe you could try asking about how to run a program on the client computer when you have access to the registry in a JavaScript specific forum. Sorry I can't be of more help. Cheers, Will H
-
I'm sorry but I have no experience with JavaScript at all. It seems to be quite difficult to launch an external program from a script though, for security reasons. I did, however, find this[^] discussion. There is one part that may interest you:
IF you have access to each client to add a regsitry key you can do what you want seamlessly ...
To execute c:\my prog\prog.exe %a %b %cAdd to a new key to HKEY_CLASSES_ROOT called 'myprog'
Add an empty string to this key called 'URL Protocol'
Add the sub-keys: \shell\open\command
Set the value of the default string inside the command key to: "c:\my prog\prog.exe %1"On your web page have your link as:
<A HREF="myprog: %a %b %c">run myprog</A>(%a, %b and %c are arguments i think). I know you are doing this from a script, but you can probably do some sort of redirect to call the link. I have no idea, but
location.href= "myprog: %a %b %c";
might work. Maybe you could try asking about how to run a program on the client computer when you have access to the registry in a JavaScript specific forum. Sorry I can't be of more help. Cheers, Will H
nice idea man :-) i have done something else. since the script is local on my computer, it do not alert any security issues when i execute a program using Shell.run("blabla.exe") so i just add a parameter to the execution with the current link. its working. now i draged it into c# issue and it will be easier for me. thanks alot, Ran Z. R.Z
-
nice idea man :-) i have done something else. since the script is local on my computer, it do not alert any security issues when i execute a program using Shell.run("blabla.exe") so i just add a parameter to the execution with the current link. its working. now i draged it into c# issue and it will be easier for me. thanks alot, Ran Z. R.Z