Filipe35
Messages postés470Date d'inscriptionvendredi 14 novembre 2003StatutMembreDernière intervention23 octobre 20071 21 janv. 2005 à 18:45
Salut,
c'est un source que j'avais trouvé pour VB.
son nom c'était Dos par pipe.
en gros elle permettait de lancer une aplication dos
et de l'afficher dans un mémo...(en cours de fonctionnement)
mais la j'ai juste besoin de récupéré le résultat.
J'ai trouvé la solution pour Delphi (elle ne vient pas de moi):
Elle était devant mes yeux, cf ma source RAR PASS Cracker pour lancer Unrar.exe
procedure RunDosInMemo(DosApp:String;Aedit:TEdit) ;
const
ReadBuffer = 2400;
var
Security : TSecurityAttributes;
ReadPipe,WritePipe : THandle;
start : TStartUpInfo;
ProcessInfo : TProcessInformation;
Buffer : Pchar;
BytesRead : DWord;
Apprunning : DWord;
begin
With Security do begin
nlength := SizeOf(TSecurityAttributes) ;
binherithandle := true;
lpsecuritydescriptor := nil;
end;
if Createpipe (ReadPipe, WritePipe,
@Security, 0) then begin
Buffer := AllocMem(ReadBuffer + 1) ;
FillChar(Start,Sizeof(Start),#0) ;
start.cb := SizeOf(start) ;
start.hStdOutput := WritePipe;
start.hStdInput := ReadPipe;
start.dwFlags := STARTF_USESTDHANDLES +
STARTF_USESHOWWINDOW;
start.wShowWindow := SW_HIDE;