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?
Re: 2 Instances of Web Browser
Wierd. I have server apps running all with WebBrowser controls. No problem with me.
Re: 2 Instances of Web Browser
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.
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)?
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......
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.