PDA

Click to See Complete Forum and Search --> : Checking if another application is running


[T3]bill
Jul 3rd, 2001, 01:27 PM
Is there a way to check and see if another program is running?
I want to be able to see if Excel is running and if it is use the instance already open instead of making another.

Megatron
Jul 3rd, 2001, 02:42 PM
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 hExcel As Long
hExcel = FindWindowEx(0, 0, "XLMAIN", vbNullString)
If hExcel <> 0 Then MsgBox "Excel is running"
End Sub

kchanning
Jul 3rd, 2001, 06:00 PM
Okay ... this is all good, butwhat if the app you are looking for is one you have created ex: mls_interface.exe ... how would I check to see if this application is currently running? :confused: