ironwit
Advanced Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору попробуй это, у меня работает function EXECAndWAIT(const FileName, Params: ShortString; const WinState: Word): boolean; var StartInfo: TStartupInfo; ProcInfo: TProcessInformation; begin { Put the name of file between quotes, due to spaces in names of files in system Win9x } FillChar(StartInfo, SizeOf(StartInfo), #0); with StartInfo do begin cb := SizeOf(StartInfo); dwFlags := STARTF_USESHOWWINDOW; wShowWindow := WinState; end; Result := CreateProcess(nil,pchar(string(Filename+' '+Params)), nil, nil, false, CREATE_NEW_CONSOLE, nil, nil,StartInfo,ProcInfo); { WAIT the finish of program } if Result then begin CloseHandle(ProcInfo.hThread); WAITForSingleObject(ProcInfo.hProcess, INFINITE); { Free the Handles } CloseHandle(ProcInfo.hProcess); end; end;
---------- Don't drink, and drive. Smoke and fly. |
|