You use the FindWindow function to find it by knowing it's caption.
Code:Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As Any, ByVal lpWindowName As Any) As Long Dim h h = FindWindow(vbNullString, "Calculator") If h = 0 Then MsgBox "Window was not found!", 16 Else MsgBox "Found!": Exit Sub End If




Reply With Quote