Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. programing Internet Explorer

programing Internet Explorer

Scheduled Pinned Locked Moved C#
question
6 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    ranzask
    wrote on last edited by
    #1

    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

    K 1 Reply Last reply
    0
    • R ranzask

      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

      K Offline
      K Offline
      kasik
      wrote on last edited by
      #2

      You might want to take a look at this[^] article from MSDN. You will need to use 0x20 as the value of your Contexts 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

      R 1 Reply Last reply
      0
      • K kasik

        You might want to take a look at this[^] article from MSDN. You will need to use 0x20 as the value of your Contexts 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

        R Offline
        R Offline
        ranzask
        wrote on last edited by
        #3

        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

        K 1 Reply Last reply
        0
        • R ranzask

          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

          K Offline
          K Offline
          kasik
          wrote on last edited by
          #4

          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 %c

          Add 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

          R 1 Reply Last reply
          0
          • K kasik

            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 %c

            Add 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

            R Offline
            R Offline
            ranzask
            wrote on last edited by
            #5

            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

            K 1 Reply Last reply
            0
            • R ranzask

              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

              K Offline
              K Offline
              kasik
              wrote on last edited by
              #6

              ranzask wrote:

              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")

              That seems like a much better way than my idea. I'm glad you've got it sorted :) Cheers, Will H

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups