Results 1 to 2 of 2

Thread: Handle of IE window

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2000
    Posts
    71

    Question

    Hi , as we know notice the caption of the IE window changes as we surf net . The 'findwindow' api can use caption or classname to find handles. Is it possible to define a classname & use 'findwindow' api to find the handle of the IE window even when its caption has change ? Actually , i was wondering if there is a universal classname for IE windows so that i can use to obtain the handle of the IE window even after it caption has changed .

  2. #2
    Guest
    Internet Explorer's classname is ieframe.


    Code:
    Private Declare Function FindWindow _
    Lib "user32.dll" Alias "FindWindowA" (ByVal _
    lpClassName As String, ByVal lpWindowName As String) _
    As Long
    
    
    Private Sub Command1_Click()
    
        Dim hWin As Long
        hWin = FindWindow("ieframe", vbNullString)
        If hWin <> 0 Then
            Msgbox "IE hWnd:  " & hWin
        Else
            Msgbox "Window not found!", 16
        End If
    
    End Sub

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