1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Procedure Appel_6;
Var StartInfo : TStartupInfo;
ProcessInfo : TProcessInformation;
Fin : Boolean;
Ligne_Cmd : string;
begin
FillChar(StartInfo,SizeOf(StartInfo),#0);
StartInfo.cb := SizeOf(StartInfo);
Form1.Visible := False;
Ligne_Cmd := PCHar(Nom_Editeur) + ' ' + PChar(F_Cible);
If CreateProcess(Nil, PChar(Ligne_Cmd)
, Nil, Nil, False, 0, Nil, Nil, StartInfo, ProcessInfo) then
Begin
Fin := False;
Repeat
Case WaitForSingleObject(ProcessInfo.hProcess, 200)Of
WAIT_OBJECT_0 : Fin := True; { L'application est terminée, on sort }
WAIT_TIMEOUT : ; { elle n'est pas terminée, on continue d'attendre }
End;
Application.ProcessMessages;
Until Fin;
End
Else
begin
RaiseLastOSError;
Form1.Visible := True;
Application.ShowMainForm := True;
end;
Form1.Visible := True;
SetForegroundWindow(Handle_App);
End; |
Partager