Ver Mensaje Individual
  #7  
Antiguo 28-07-2005
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is online now
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 19.437
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cambia ésta línea:
Código Delphi [-]
   Win32Check(CreateProcess(nil, 'NOTEPAD.EXE', nil, nil, FALSE,
                            CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));
por ésta otra (tal vez tu path no sea WinNT sino Windows).
Código Delphi [-]
 Win32Check(CreateProcess(nil, 'c:\winnt\system32\cmd.exe', nil, nil, FALSE,
                            CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));

y ésta:
Código Delphi [-]
 hNotepad := FindThreadWindow(ProccesInfo.dwThreadId, 0, nil, nil);
por éstas dos.
Código Delphi [-]
   sleep(500);
   hNotepad := FindWindow('ConsoleWindowClass', nil);
  
   NOTA: el tema del Sleep no acaba de gustarme (aunque funciona); tal vez
   alguien tenga alguna idea mejor, porque esta es un poco "chapuza", por
   no decir "bastante chapuza".
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita