Results 1 to 7 of 7

Thread: 2 Instances of Web Browser

  1. #1

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Question 2 Instances of Web Browser

    I have created a web browser using the WebBrowser control in VB6. After compiling the EXE, when I run the browser, though only 1 instance of the web browser opens up, Windows Task Manager in WinXP (right-click any vacant area on the taskbar & select Task Manager) lists it 2 times (under the Applications) tab).

    Assume that the home page of the browser named MyBrowser is about:blank. When I run the EXE, Windows Task Manager lists MyBrowser twice. The 2 tasks are named

    about:blank - MyBrowser
    MyBrowser

    When I right click the former in Windows Task Manager & click Bring to Front, Windows Task Manager loses the focus & the focus shifts to the already open browser making it the active window but when I right-click the latter in Windows Task Manager & click Bring to Front, then Windows Task Manager loses the focus (which I can make out by the change in color of the titlebar) but the focus doesn't shift to the open browser. In fact, none of the open apps have the focus under such circumstances.

    What could be the reason behind this?


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: 2 Instances of Web Browser

    Wierd. I have server apps running all with WebBrowser controls. No problem with me.

  3. #3

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: 2 Instances of Web Browser

    Any possible solution?


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  4. #4

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: 2 Instances of Web Browser

    Can someone please help me out with this?

    The project makes use of about 25 Forms but except for the parent Form which uses only one instance of the WebBrowser control, none of the other Forms use the WebBrowser control. It just beats me as to why Windows Task Manager lists the browser twice when I run the browser's EXE.


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  5. #5

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Question Re: 2 Instances of Web Browser

    OK....friends....I could atleast unearth why Windows Task Manager lists my browser twice. That's because of a Form named frmIntroWindow which is the start-up object in the browser app.

    frmIntroWindow has a Timer control named tmrIntro whose Interval property is set to 3000 (in the Properties window). What I want is when the app is started, tmrIntroWindow should show up as a splash screen for 3 seconds after which the parent Form named frmWebBrowser (which houses the WebBrowser control) opens up. This is the code in frmIntroWindow:

    Code:
    Private Sub tmrIntro_Timer()
        tmrIntro.Enabled = False
        Unload Me
        frmWebBrowser.Show
    End Sub
    When I run the app & within 3 seconds, I have a look at Windows Task Manager, I find MyBrowser listed there. After 3 seconds, when the parent Form with the WebBrowser control loads, Windows Task Manager lists about:blank - MyBrowser (where about:blank - MyBrowser is the title of the app which means that about:blank can be anything whichever site the browser is currently displaying).

    Can now someone tell me why is frmIntroWindow getting listed in Windows Task Manager though I am unloading it (as shown in the above code)?


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  6. #6

    Thread Starter
    Frenzied Member arpan_de's Avatar
    Join Date
    Oct 2005
    Location
    Mumbai, India
    Posts
    1,394

    Re: 2 Instances of Web Browser

    No friends...I wa wrong in my earlier post. This is because even if I set frmWebBrowser as the start-up object instead of frmIntroWindow, then Windows Task Manager still lists MyBrowser twice though only one instance of the browser is open.

    Somebody please...please....please...help me out with this. This is driving me nuts......


    ARPAN

    IF YOU HAVE AN APPLE & I HAVE AN APPLE AND WE EXCHANGE THE APPLES, THEN YOU & I WILL STILL HAVE ONE APPLE BUT IF YOU HAVE AN IDEA & I HAVE AN IDEA AND WE EXCHANGE OUR IDEAS, THEN EACH OF US WILL HAVE TWO IDEAS!

    NOTHING IS IMPOSSIBLE IN THIS WORLD.....EVEN THE WORD IMPOSSIBLE SAYS I'M POSSIBLE!

    PRACTICE MAKES A MAN PERFECT BUT NOBODY IS PERFECT; SO WHY PRACTICE?

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: 2 Instances of Web Browser

    Maybe if you attach your project someone, maybe me, might be able to detect something. Since I don't have that problem I suspect it's something in your code making Task Manager think there are two instances running. Simply based on your posts I cannot come to any reason what's going on.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width