If you have the Process id from Shell you'll need to get the handle from it using OpenProcess
Code:
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Then with that you can loop around till it finishs with WaitForSingleObject
Code:
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Then when its done close the handle with CloseHandle
Code:
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
For example (this may not run as i'm just going from memory)
Code:
processID = Shell("MyProg.exe",vbNormalFocus)
If processID <> 0 then
procHandle = OpenProcess(Process_Query_Information,0,processID)
if procHandle <> 0 then
rc = WaitForSingleObject(procHandle,100)
do while rc <> 0
rc = WaitForSingleObject(procHandle,100)
DoEvents
loop
CloseHandle(procHandle)
end if
msgbox "process has ended"
end if
That will let you know if the process is running. Well actually that will more wait for a process to finish then let you know.
you could change that to set a boolean to true before the do loop called isRunning and then set it to false when its finished. Then you could just query your boolean.