くだすれDelphi(超初心者用)その25
■ このスレッドは過去ログ倉庫に格納されています
0473デフォルトの名無しさん
2005/06/28(火) 17:06:34CreateProcessを使いましょう
aExeはファイル名、aWaitはTrueなら終了待ち、Falseなら終了待たない
function Launch(aExe: String; aWait: Boolean):Boolean;
var
Si: TStartupInfo;
Pi: TProcessInformation;
begin
Result := True;
FillChar(Si, Sizeof(TStartupInfo), 0);
FillChar(Pi, Sizeof(TProcessInformation), 0);
GetStartupInfo(Si);
if not CreateProcess(nil, PChar(aExe), nil, nil, False, NORMAL_PRIORITY_CLASS, nil, nil, SI, PI) Then
begin
Result := False;
exit;
end;
if AWait then
begin
While WaitForSingleObject(PI.hProcess, 0) = WAIT_TIMEOUT Do
Application.ProcessMessages;
end;
end;
■ このスレッドは過去ログ倉庫に格納されています