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 / C++ / MFC
  4. Launch an Application from Event in HTMLVIEW

Launch an Application from Event in HTMLVIEW

Scheduled Pinned Locked Moved C / C++ / MFC
c++javascriptlinuxtoolsquestion
3 Posts 3 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.
  • A Offline
    A Offline
    aolinc38
    wrote on last edited by
    #1

    I need a way to launch an external application (like notepad.exe) from a click within the page displayed in the CHTMLVIEW of an MFC application. I accomplished this with wscript.shell.run in javascript but I get an annoying prompt every time with a yes or no for whether i want to allow the active X content to run. ALL the internet explorer script and active X stuff has been set to "Enable" and i still get this. Is there some better way to launch an application based on a link in the webpage that won't prompt the user each time?

    B A 2 Replies Last reply
    0
    • A aolinc38

      I need a way to launch an external application (like notepad.exe) from a click within the page displayed in the CHTMLVIEW of an MFC application. I accomplished this with wscript.shell.run in javascript but I get an annoying prompt every time with a yes or no for whether i want to allow the active X content to run. ALL the internet explorer script and active X stuff has been set to "Enable" and i still get this. Is there some better way to launch an application based on a link in the webpage that won't prompt the user each time?

      B Offline
      B Offline
      botnet
      wrote on last edited by
      #2

      Well I know that you can launch an exe with Internet Explorer by assigning a protocol to the exe Insert the following into the registry:

      [HKEY_CLASSES_ROOT\notepad]
      @="URL:notepad Protocol"
      "URL Protocol"=""

      [HKEY_CLASSES_ROOT\notepad\shell]

      [HKEY_CLASSES_ROOT\notepad\shell\open]

      [HKEY_CLASSES_ROOT\notepad\shell\open\command]
      @="\"c:\\notepad.exe\" \"%1\""

      Your link will then need to be notepad:parameters where parameters are the parameters you wish to pass. Change notepad above to whatever name you wish for your protocol.

      1 Reply Last reply
      0
      • A aolinc38

        I need a way to launch an external application (like notepad.exe) from a click within the page displayed in the CHTMLVIEW of an MFC application. I accomplished this with wscript.shell.run in javascript but I get an annoying prompt every time with a yes or no for whether i want to allow the active X content to run. ALL the internet explorer script and active X stuff has been set to "Enable" and i still get this. Is there some better way to launch an application based on a link in the webpage that won't prompt the user each time?

        A Offline
        A Offline
        Ahmed Charfeddine
        wrote on last edited by
        #3

        i suggest you take a look at many articles here in CP by people who mamanged to intercept javascrip or url click inside HTML doc displayed through CHTMLView. Thus you will be able to code whatsoever application or action you may want to execute via the C++ code. Good luck.

        Our Philosophy, Mohammed Baqir Al Sadr

        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