Как проверить закончилась ли програма?

Нужно чтоб стартовали Дос-програму - ARJ, и знали когда он закончил свою работу. Из Аксес97 надо стартовать arj.
Public Function ShellWait(cCommandLine$) As Boolean
Dim NameOfProc As PROCESS_INFORMATION
Dim NameStart As STARTUPINFO
Dim ret As Long
NameStart.cb = Len(NameStart)
ret = CreateProcessA(0&, cCommandLine, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, NameStart, NameOfProc)

If (ret <> 0) Then
Call WaitForSingleObject(NameOfProc.hProcess, INFINITE)
Call CloseHandle(NameOfProc.hProcess)
ShellWait = True
Else
ShellWait = False
End If
End Function
Можно и так...

Private Sub Command1_Click()
Command1.Enabled = False
Dim TempFile As String, i As String
TempFile = "c:\arj.tmp"
Open TempFile For Output As 1
Close 1
i = Shell("c:\arj\arj.exe e c:\archive.arj >> " & TempFile, vbHide)
Do While FileLen(TempFile) = 0
DoEvents
Loop
Kill (TempFile)
Command1.Enabled = True
End Sub

TopList Rambler's Top100