|
-
Jun 25th, 2000, 02:50 AM
#1
Thread Starter
Lively Member
I am trying to Find The Child hWnd of an AOL Parent, The Code below works for EVERY thing else but for some reason it isnt working for Child Windows Can any one help me out on this?.
Jeremy
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Dim hWnd1 As
Dim hWnd2 As Long
Dim slength As Long
Dim wintext As String
Dim retval As Long
Private Sub Command1_Click()
hWnd1 = FindWindow(vbNullString, "America Online")
hWnd2 = FindWindowEx(hWnd1, 0&, "Write Mail", vbNullString)
If hWnd2 = 0 Then
Debug.Print "Window Not Found"
Else
slength = GetWindowTextLength(hWnd2)
wintext = Space(slength + 1)
retval = GetWindowText(hWnd2, wintext, slength + 1) wintext = Left(wintext, slength)
Debug.Print "Window name is: "; wintext
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|