Hi, basically, I need to know, how I can check if a window is open, and if it is do something.
The window is in another program :)
Printable View
Hi, basically, I need to know, how I can check if a window is open, and if it is do something.
The window is in another program :)
Use the FindWindowEx function.
VB 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, "ClassName", "WindowName") If hApp <> 0 Then MsgBox "Window is open End Sub