Hi Delphi Star,
Dekleration:
Delphi-Quellcode:
procedure cmdNewLine(Sender: TObject; NewLine: string; OutputType: TOutputType);
procedure cmdTerminated(Sender: TObject; ExitCode: Cardinal);
var
cmd: TDoscommand;
Bei OnCreate deines Forms:
Delphi-Quellcode:
cmd := TDoscommand.Create(self);
cmd.OnNewLine := cmdNewLine;
cmd.OnTerminated := cmdTerminated;
Anwendung von TDoscommand:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
begin
cmd.CommandLine := 'c:\run.bat';
cmd.Execute;
end;
procedure TForm1.cmdTerminated(Sender: TObject; ExitCode: Cardinal);
begin
cmd.Stop;
end;
procedure TForm1.cmdNewLine(Sender: TObject; NewLine: string; OutputType: TOutputType);
begin
//Irgendwas mit NewLine machen.
end;
MFG Chris.