Kdysi jsem si stáhnul tento příklad: Option Explicit 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 OpenProcess Lib "kernel32" _ (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, _ ByVal dwProcessId As Long) As Long Private Const INFINITE = -1 Private Const SYNCHRONIZE = &H100000 Private Sub Command1_Click() Dim iTask As Long, ret As Long, pHandle As Long iTask = Shell("notepad", vbNormalFocus) Rem Shell "mplayer.exe /play c:\media\film\urednik.mpe", vbNormalFocus pHandle = OpenProcess(SYNCHRONIZE, False, iTask) ret = WaitForSingleObject(pHandle, INFINITE) ret = CloseHandle(pHandle) MsgBox "Process Finished!" End Sub Luboš
|