Einzelnen Beitrag anzeigen

Benutzerbild von Sprint
Sprint

Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
 
Delphi 5 Professional
 
#1

Anwendung starten und warten bis diese beendet ist

  Alt 27. Dez 2004, 23:54
Delphi-Quellcode:
uses
  System.Diagnostics;
Delphi-Quellcode:
function RunAppAndWait(const AFileName: string): Boolean;
var
  NewProcess: Process;
begin

  NewProcess := Process.Create;
  with NewProcess do
  begin
    StartInfo.FileName := AFileName;
    try
      Result := Start;
      while (not HasExited) do
      begin
        WaitForExit(125);
        Application.DoEvents;
      end;
    except
      Result := False;
    end; {end try/except}
  end; {end with}

end; {end function}
[edit=Chakotay1308]Titel angepasst. Mfg, Chakotay1308[/edit]
Ciao, Sprint.

"I don't know what I am doing, but I am sure I am having fun!"
  Mit Zitat antworten Zitat