-
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!
-
hWnd1 = What Parent to search
hWnd2 = What Child to start at
lpsz1 = ClassName
lpsz2 = WindowName
This next example will find Calculator.
Code:
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