I think the OP wants to monitor an external Exe and be notified when it has exited/closed? If thats the case search the forum, there are many examples already posted, , heres another one...
The attached snippet is originally form Penagate but I modified it a bit since the determination of the target application's closing is not handled correctly. This is without using a timer.
Regards,
™
As a gesture of gratitude please consider rating helpful posts. c",)
its like a launcher, that prevents ant-hack actions. and, when the process of the its over, i want that to appears a msgbox informing that the process is over. i'll see the codes that you posted here. thanks
If you are checking for the EXE very often, like once per second or less, you could make the routine slightly more efficient by saving and comparing just the process ID for the exe once its found.
Add to declares...
Code:
Private ExePID As Long
Add to the end of Sub WatchOff...
Code:
ExePID = 0
Update the Function CheckForExe...
Code:
For L = 0 To cbNeeded / 4
If ExePID = 0 Then
' Find matching filename and save its Process ID if found
If ProcessIDs(L) > 0 Then sTitle = CutPath(GetExePathFromPID(ProcessIDs(L)))
If LCase$(sTitle) = LCase$(ExeFile) Then
CheckForExe = True
ExePID = ProcessIDs(L)
Exit For
End If
Else ' we already know the PID of the exe so just check for matching PID.
If ExePID = ProcessIDs(L) Then
CheckForExe = True
Exit For
End If
End If
Next L