- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
//==============================================================================
function TMainForm.RunApp(runapp : string) : bool;//Ф-ция создания процесса
var
si : TStartupInfo;
pi : TProcessInformation;
begin
Result := false;
try
ZeroMemory(@si,SizeOf(si));
si.cb := SizeOf(si);
si.dwFlags := STARTF_USESHOWWINDOW;
si.wShowWindow := sw_hide;
if CreateProcess(nil,PChar(runapp),nil,nil,False,0,nil,nil,si,pi)=true then Result := true;
try
CloseHandle(pi.hThread);
except;
end;//А вдруг прокатит?
WaitForSingleObject(pi.hProcess, INFINITE);
sleep(100);
try
CloseHandle(pi.hProcess);
except ;
end;
except
Result := false;
end;
end;
//==============================================================================
Комментарии (0) RSS
Добавить комментарий