PDA

Click to See Complete Forum and Search --> : FindWindowEx


HAVocINCARNATE29
Sep 14th, 2000, 04:00 PM
I'm using:

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


could someone explain how i use this function and the values i need for this function:

hWnd1
hWnd2
lpsz1
lpsz2


thanks! i appreciate it!

Sep 14th, 2000, 04:07 PM
hWnd1 = What Parent to search
hWnd2 = What Child to start at
lpsz1 = ClassName
lpsz2 = WindowName

This next example will find Calculator.

Private 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

Private Sub Command1_Click()

Dim hApp As Long

hApp = FindWindowEx(0, 0, "SciCalc", "Calculator")
If hApp <> 0 Then MsgBox "Calculator is open"

End Sub