Hola SpeedCad.
El siguiente código controla cuando una aplicación NO lanzada desde vb termina. No es exactamente lo que pides, pero tal vez te sirva...
Private Const SYNCHRONIZE = &H100000
Private Const INFINITE = -1&
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Sub Sincronizar()
Dim pid As PROCESS_INFORMATION
Dim lngRc As Long
lngRc = FindWindow(vbNullString, "Pon aquí el título de la ventana de la aplicación")
lngRc = GetWindowThreadProcessId(lngRc, pid.hProcess)
lngRc = OpenProcess(SYNCHRONIZE, False, pid.hProcess)
If lngRc <> 0 Then
lngRc = WaitForSingleObject(lngRc, INFINITE)
MsgBox "Fin del proceso"
Else
MsgBox "Fallo sincronizando"
End If
End Sub
Espero que te sirva.
Chao.