PDA

Click to See Complete Forum and Search --> : Check App


Richyrich
May 18th, 2001, 03:19 AM
How do I check to see if an application is runnning, if it is I just want to wait until it has completed.

Thanks

Matthew Gates
May 18th, 2001, 06:19 AM
To see if an application is running by knowing it's exe, take a look at this thread (http://www.vbforums.com/showthread.php?s=&threadid=11639).

Or you can use the FindWindow API function.

Private Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long


Private Sub Command1_Click()

Dim hWin As Long
hWin = FindWindow("SciCalc", "Calculator")
'FindWindow(class,caption)
If hWin <> 0 Then
Msgbox "Window found!", 64, hWin
Else
Msgbox "Window not found, 64, hWin
End If

End Sub

Richyrich
May 18th, 2001, 06:31 AM
Thanks, I presume this is ok on NT?