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. C / C++ / MFC
  3. New browser as child window of existing one?

New browser as child window of existing one?

Scheduled Pinned Locked Moved C / C++ / MFC
4 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.
  • M Offline
    M Offline
    mahesh
    wrote on last edited by
    #1

    Hello, I want to create a new browser as a child window of existing one? Can i do that? Any ideas?? I am using IWebBrowser2 interface. But it opens my page into default browser. regards, Mahesh

    E 1 Reply Last reply
    0
    • M mahesh

      Hello, I want to create a new browser as a child window of existing one? Can i do that? Any ideas?? I am using IWebBrowser2 interface. But it opens my page into default browser. regards, Mahesh

      E Offline
      E Offline
      Erik Thompson
      wrote on last edited by
      #2

      Since you are using the Internet Explorer browser control, you can insert an IFRAME HTML tag set into your existing web browser control and have the iframe navigate to the page you want. use innerHTML method and then call execScript with code to have the IFRAME navigate elsewhere. It's one way. -Erik Thompson

      M 1 Reply Last reply
      0
      • E Erik Thompson

        Since you are using the Internet Explorer browser control, you can insert an IFRAME HTML tag set into your existing web browser control and have the iframe navigate to the page you want. use innerHTML method and then call execScript with code to have the IFRAME navigate elsewhere. It's one way. -Erik Thompson

        M Offline
        M Offline
        mahesh
        wrote on last edited by
        #3

        Thanks Erik, Is there any way without frames? My requirement is not to use frames.

        B 1 Reply Last reply
        0
        • M mahesh

          Thanks Erik, Is there any way without frames? My requirement is not to use frames.

          B Offline
          B Offline
          Brian Hart
          wrote on last edited by
          #4

          Dear Mahesh, There are events that the WebBrowser control emits, which you can handle by implementing the DWebBrowserEvents2 dispatch interface in your program (or something, I forget :) ). The event OnBeforeNavigate or OnBeforeNavigate2 (I forget again :) ) are called or fired after the Navigate() method is called but before navigation begins. It is passed parameters like the URL, do we want to cancel, so forth. What I would do is to put new child-window-creation code in there, and pass the URL to the new window, which itself could contain a WebBrowser control. Cheers, Brian Hart :)

          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