Comment passer le text d'1 edit de mon pg vers un edit d'un pg console qui n'acc

cs_younesken1 Messages postés 39 Date d'inscription jeudi 19 mai 2005 Statut Membre Dernière intervention 23 mars 2011 - 12 nov. 2005 à 13:52
aiglon3 Messages postés 10 Date d'inscription dimanche 23 janvier 2005 Statut Membre Dernière intervention 24 novembre 2005 - 24 nov. 2005 à 22:31
bon voila:
g une application console.(*.exe)(pas de code source)
cette application a un edit qui ne supporte pas de copier/coller.
je devellopes une application dans laquelle je recherche des information et qui apparaitrons en sortie dans un de mes composants Tedit.
il faut que je copie ces information ds l'application console que g.
je voudrai, si c'est possible, ajouter un boutton ds lequel en clicant sur lui pourras transmetre le text de cet edit vers l'application console.
si vous pouvez m'aider sa serai formidable.

2 réponses

Filipe35 Messages postés 470 Date d'inscription vendredi 14 novembre 2003 Statut Membre Dernière intervention 23 octobre 2007 1
13 nov. 2005 à 09:40
Je pense qu'il te faudrat manipuler les handles.

__________________________________________________
http://www.OgameTut.Free.Fr - Le site sur ogame de référence !
http://Signz.free.fr - Le gén&#
0
aiglon3 Messages postés 10 Date d'inscription dimanche 23 janvier 2005 Statut Membre Dernière intervention 24 novembre 2005
24 nov. 2005 à 22:31
Voici la procedure pour voir un application console dans un TMemo:
(L'exemple montre la fonction console NetStat)

procedure RunDosInMemo(Que:String;EnMemo:TMemo);
const
CUANTOBUFFER = 2000;
var
Seguridades : TSecurityAttributes;
PaLeer,PaEscribir : THandle;
start : TStartUpInfo;
ProcessInfo : TProcessInformation;
Buffer : Pchar;
BytesRead : DWord;
CuandoSale : DWord;
begin
With Seguridades do
begin
nlength := SizeOf(TSecurityAttributes);
binherithandle := true;
lpsecuritydescriptor := nil;
end;
if Createpipe (PaLeer, PaEscribir, @Seguridades, 0) then
begin
Buffer := AllocMem(CUANTOBUFFER + 1);
FillChar(Start,Sizeof(Start),#0);
start.cb := SizeOf(start);
start.hStdOutput := PaEscribir;
start.hStdInput := PaLeer;
start.dwFlags := STARTF_USESTDHANDLES +
STARTF_USESHOWWINDOW;
start.wShowWindow := SW_HIDE;


if CreateProcess(nil,
PChar(Que),
@Seguridades,
@Seguridades,
true,
NORMAL_PRIORITY_CLASS,
nil,
nil,
start,
ProcessInfo)
then
begin
repeat
CuandoSale := WaitForSingleObject( ProcessInfo.hProcess,100);
Application.ProcessMessages;
until (CuandoSale <> WAIT_TIMEOUT);
Repeat
BytesRead := 0;
ReadFile(PaLeer,Buffer[0],CUANTOBUFFER,BytesRead,nil);
Buffer[BytesRead]:= #0;
OemToAnsi(Buffer,Buffer);
EnMemo.Text := EnMemo.text + String(Buffer);
until (BytesRead < CUANTOBUFFER);
end;
FreeMem(Buffer);
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
CloseHandle(PaLeer);
CloseHandle(PaEscribir);
end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
RunDosInMemo('Netstat',Memo1);
end;

;)
a+
Denis
0
Rejoignez-nous