Results 1 to 7 of 7

Thread: help me please!

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    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.
    ______________

  2. #2
    Guest
    ummmmm.... that code doesnt even work for me.....

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    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)
    ______________

  4. #4
    Guest
    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]

  5. #5
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177
    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

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Pittsburgh, PA
    Posts
    329
    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!
    ______________

  7. #7
    Guest
    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 .

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