Ver Mensaje Individual
  #4  
Antiguo 16-11-2017
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
Hola.

¿ Y no te serviría usar la función CreateProcess ?

Un ejemplo:
Código PHP:
void createProcesswaiting( char* fullExefilename )
{
  
PROCESS_INFORMATION PI;
  
STARTUPINFO SI;

  
ZeroMemory( &SI, sizeof( SI ) );
  
SI.cb = sizeof( SI );

  if( 
CreateProcess( NULL, fullExefilename, NULL, NULL, false, 
        
NORMAL_PRIORITY_CLASS, NULL, NULL, &SI, &PI ) )
    
WaitForSingleObject( PI.hThread, INFINITE );

  
CloseHandle( PI.hProcess );
  
CloseHandle( PI.hThread );
} 
Llamada ejemplo:
Código PHP:
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  
createProcesswaiting( "C:\\WINDOWS\\SYSTEM32\\CALC.EXE" );
  
createProcesswaiting( "C:\\WINDOWS\\NOTEPAD.EXE" );
  
createProcesswaiting( "C:\\WINDOWS\\REGEDIT.EXE" );
  
//...
} 
Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....
Responder Con Cita