-
i set a reference to ms internet controls and did this:
form_load()
Dim ie as new InternetExplorer
ie.navigate "www.vb-world.net"
ie.visible = true
end sub
now how do i use OnQuit to tell me when the new internet explorer window is closed??
thanks for your time and thanks in advance for any help i get.
-
ummmmm.... that code doesnt even work for me.....
-
did you set a reference to microsoft internet controls?
Note:
(and sometimes there are 2 microsoft internet controls in the reference page. you have to set them both. (and if there is 2 then adjust your priority with the little arrows until the new microsoft internet controls you set has the higher priority)
-
Dennis, that's because you didn't set the Webbrowser control as a reference.
And HAVocINCARNATE29, you could try finding the hwnd.
Code:
Dim h As Integer
Private Sub Form_Load()
Dim ie As New InternetExplorer
ie.Navigate "www.vb-world.net"
ie.Visible = True
h = ie.hWnd
End Sub
'and the just find the window from a timer so you can keep looping.
Not sure if it'll work, but it's a try.
Heh, took me 11 minutes to reply.
[Edited by Matthew Gates on 08-10-2000 at 09:45 PM]
-
You could also make use of the WithEvents Keyword, i.e.
Code:
Private WithEvents oNewWindow As SHDocVw.InternetExplorer
Private Sub Command1_Click()
Set oNewWindow = New SHDocVw.InternetExplorer
oNewWindow.Navigate "http://www.vb-world.net"
oNewWindow.Visible = True
End Sub
Private Sub oNewWindow_OnQuit()
MsgBox "New Window Closed"
End Sub
-
hey thanks for all your help! i got it working.
one last thing and i know this is gonna sound real simple but i've got 2 books (beginner and intermediate) on vb and neither talks about hwnd at all. i tried the microsoft stuff but it wasnt much help.
if you could tell me (in short) what a hwnd is and how to use it i'd be very happy.
thanks again everyone!
-
The hWnd is the window's handle. It is used and needed to access something from an external (or internal) application. This is not the best definition for hwnd, but it's okay. If you have a program's hWnd, you could maximize, minimize, restore, disable, enable anything on the form. Basically, an API Spy (which can get a program's handle) and API in general could get you through VB life. And may get you somewhere in life as well :p.