Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _ ByVal lpCaption As String) Function IsAppRunning() Dim strClassName As String Dim strCaption As String 'Programs classname and caption strClassName = "SciCalc" strCaption = "Calculator" 'Print the handles returned with the following criteria Print "Handle = ";FindWindow(strClassName, 0&) Print "Handle = ";FindWindow(0&, strCaption) Print "Handle = ";FindWindow(strClassName,strCaption) End Function |