Sorry, der Quellcode war irreführend. Ich habe da schon mit verschiedenen Möglichkeiten herumexperimentiert. Auch der untenstehende Code zeigt immer das Fenster an, nur mit
dem Unterschied, dass es nicht nur kurz erscheint, sondern dort stehen bleibt, bis sich
der gestartete Prozess terminiert.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22:
| function TRexCtrl.RunApp(const sFileName, sArg: string): cardinal; var NewProcess: Process; begin NewProcess := Process.Create; with NewProcess do begin StartInfo.FileName := sFileName; StartInfo.CreateNoWindow := True; StartInfo.WindowStyle := System.Diagnostics.ProcessWindowStyle.Hidden; try Start(sFileName, sArg); finally if NewProcess<>nil then begin close; NewProcess:=nil; end; end; end; Result:=0; end; |