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. When a WebBrowser2 control navigate a Web Page,how to drop selected range's html source to a EditBox control?

When a WebBrowser2 control navigate a Web Page,how to drop selected range's html source to a EditBox control?

Scheduled Pinned Locked Moved C / C++ / MFC
htmlhelptutorialquestion
3 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.
  • C Offline
    C Offline
    ChengMing Liu
    wrote on last edited by
    #1

    In my application, have a EditBox and a WebBrowser2 control,I want to drop a select range's html source to the EditBox control,when I use WebBrowser2 control to navigate a Web page. My original way is,when a event(mouse dorp) coming , I send a copy(Ctrl + C) event, then paste the content in the clipboard,but I think is effect on the other program. So I want other way for resolute this problem. Very thanks.

    S 1 Reply Last reply
    0
    • C ChengMing Liu

      In my application, have a EditBox and a WebBrowser2 control,I want to drop a select range's html source to the EditBox control,when I use WebBrowser2 control to navigate a Web page. My original way is,when a event(mouse dorp) coming , I send a copy(Ctrl + C) event, then paste the content in the clipboard,but I think is effect on the other program. So I want other way for resolute this problem. Very thanks.

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      Use the DOM to get a pointer to the IHTMLInputElement which represents your editbox. Then set the new value, and call reset() on the embedding Form to apply the new value.


      Back to real work : D-24.

      C 1 Reply Last reply
      0
      • S Stephane Rodriguez

        Use the DOM to get a pointer to the IHTMLInputElement which represents your editbox. Then set the new value, and call reset() on the embedding Form to apply the new value.


        Back to real work : D-24.

        C Offline
        C Offline
        ChengMing Liu
        wrote on last edited by
        #3

        very thanks,Have you got other way? eg: I use IHTMLDocument2 interface, call IHTMLDocument2::get_selection() get a IHTMLSelectionObject interface, and call IHTMLSelectionObject::createRange() get IDispatch then I didn't know how to get innerHTML From IDispatch. my idea was born from a javascript function(document.selection.createRange().innerHTML)

        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