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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
| unit Principale;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MediaInfoDll, DosCommand;
type
TForm2 = class(TForm)
Button1: TButton;
Memo1: TMemo;
DosCommand: TDosCommand;
procedure Button1Click(Sender: TObject);
procedure DosCommandNewLine(Sender: TObject; NewLine: String; OutputType: TOutputType);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form2: TForm2;
Chaine: string;
AccesFonctionsMedia: MesFonctionMediaInfo;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
AccesFonctionsMedia:=MesFonctionMediaInfo.create();
Chaine:='';
DosCommand:=TDosCommand.Create(nil);
DosCommand.OnNewLine:=DosCommandNewLine;
DosCommand.CommandLine :='Je met la commande';
DosCommand.Execute;
DosCommand.SendLine('Exit', True);
DosCommand.free;
ShowMessage(Chaine);
end;
procedure Tform2.DosCommandNewLine(Sender: TObject; NewLine: String; OutputType: TOutputType);
var
i: integer;
ID, name: string;
begin
i:=15;
ID:=''; Name:='';
If Pos('ID',Newline) = 12 then
begin
while Newline[i]<>':' do begin
ID:= ID+ Newline[i];
inc(i);
end;
i:=Pos('file',Newline)+11;
While i <> Length(NewLine) do begin
Name:= Name+ Newline[i];
inc(i);
end;
Chaine:=Chaine+ ID + ' : ' + Name +'|';
//Memo1.Lines.Add(ID + ' : ' + Name +'|');
end;
end;
end. |
Partager