executer prg sous delphi
Salut,
J'aimerai sous mon prg delphi executer un programme sous dos sans que la
fenetre de ce programme (sous dos) s'affiche, et savoir si le prg a fini
l'execution
J'ai utilisé CreateProcess mais je ne sai comment pas masquer l'execution :
begin
.....
if not
(LanceAppliAttenteFin(Extractfilepath(Application. exeName)+'\ecrire.exe'))
then ShowMessage('erreur au lancement de l''aplication');
ShowMessage ('fini');
.....
end;
function LanceAppliAttenteFin(NomFichier:string):boolean;
var
StartInfo : TStartupInfo;
ProcessInformation : TProcessInformation;
begin
result:=true;
ZeroMemory(@StartInfo, sizeof(StartInfo)); // remplie de 0 StartInfo
StartInfo.cb:=sizeof(StartInfo);
if
CreateProcess(nil,PChar(NomFichier),nil,nil,true,0 ,nil,nil,StartInfo,ProcessInformation)
then WaitForSingleObject(ProcessInformation.hProcess, INFINITE) else
result:=false;
end;
|