Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 28-02-2012
Avatar de MAXIUM
MAXIUM MAXIUM is offline
Miembro
 
Registrado: may 2005
Posts: 1.503
Poder: 23
MAXIUM Va camino a la fama
Thumbs up

Lo más cercano que encontré

Código Delphi [-]
procedure RunDosInMemo( CmdLine: string; AMemo: TMemo );
const
  ReadBuffer = 2400;
var
  Security: TSecurityAttributes;
  ReadPipe, WritePipe: THandle;
  start: TStartUpInfo;
  ProcessInfo: TProcessInformation;
  Buffer: Pchar;
  BytesRead: DWord;
  Apprunning: DWord;
begin
   Screen.Cursor := CrHourGlass;
   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;
      if CreateProcess( nil, PChar( CmdLine ), @Security, @Security, true,
                        NORMAL_PRIORITY_CLASS, nil, nil,  start, ProcessInfo ) then
      begin
         repeat
            Apprunning := WaitForSingleObject( ProcessInfo.hProcess, 100 );
            ReadFile( ReadPipe, Buffer[0], ReadBuffer, BytesRead, nil );
            Buffer[BytesRead] := #0;
            OemToAnsi( Buffer, Buffer );
            AMemo.Text := AMemo.text + string( Buffer );
            Application.ProcessMessages;
         until ( Apprunning <> WAIT_TIMEOUT );
      end;
      FreeMem( Buffer );
      CloseHandle( ProcessInfo.hProcess );
      CloseHandle( ProcessInfo.hThread );
      CloseHandle( ReadPipe );
      CloseHandle( WritePipe );
   end;
   Screen.Cursor := CrDefault;
end;
 
procedure TForm1.Button1Click(Sender: TObject);
begin
   Memo1.Clear;
   Button1.Enabled := false;
   RunDosInMemo( 'ping 127.0.0.1', Memo1 );
   // RunDosInMemo( 'net send 127.0.0.1 Привет', Memo1 );
   Button1.Enabled := true;
end;
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Ventana minimizada windows babu API de Windows 1 16-02-2009 09:54:08
Tamaño de Ventana de Windows pai_delpher API de Windows 2 31-03-2008 12:20:11
Ejecutar procedimiento en ventana main JULIPO Varios 3 26-10-2007 20:21:42
Emular ventana de windows turminator API de Windows 3 15-08-2006 00:15:25
Ejecutar en msdos sin ventana de windows apicito Varios 12 05-03-2004 21:23:58


La franja horaria es GMT +2. Ahora son las 20:11:01.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi