Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/05/2011, 09:26
t1esto
 
Fecha de Ingreso: abril-2011
Mensajes: 3
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: WaitForSingleObject

Bueno para lo que queria, ya lo he resuelto de forma un poco dudosa pero bueno, aqui va el codigo para que vean, he sustituido la primera funcion por esta
Código C++:
Ver original
  1. void ExternAPP::ExecuteInventoryEXE(){
  2.    if(this->ExistInventoryEXE()){
  3.      ShellExecute(NULL,"open",this->path.c_str(),this->parameters.c_str(),"",SW_SHOWNORMAL);
  4.    }
  5. }


Y en la forma lo que queria era, que al mismo tiempo que se ejecutaba lo que tengo en this->path.c_str() que fuera pasando un ProgessBar para saber cuando empesó y cuando terminó, pero me he cansado de tanto control y miren lo que he hecho en el OnClick de la forma.


Código C++:
Ver original
  1. void __fastcall TForm1::Button1Click(TObject *Sender)
  2. {
  3.      ProgressBar1->Position = 0;
  4.      Image1->Visible = false;
  5.      Image2->Visible = false;
  6.      Image3->Visible = false;
  7.      Image4->Visible = false;
  8.      Timer1->Enabled = true;
  9. }

Y en el Timer lo he hecho todo


Código C++:
Ver original
  1. void __fastcall TForm1::Timer1Timer(TObject *Sender)
  2. {
  3.   if(ProgressBar1->Position != 20) Button2->Enabled = false;
  4.   if(ProgressBar1->Position == 2){
  5.    Image1->Visible = true;
  6.    hPtr->ExecuteGpupdateEXE();
  7.   }
  8.   if(ProgressBar1->Position == 8){
  9.    Image2->Visible = true;
  10.    hPtr->ExecuteWuaucltEXE();
  11.   }
  12.   if(ProgressBar1->Position == 16){
  13.    if(hPtr->ExistInventoryEXE()){
  14.      hPtr->ExecuteInventoryEXE();
  15.      Image3->Visible = true;
  16.    }else if(hPtr->ExistInventoryINSTALL()){
  17.      hPtr->ExecuteInventoryINSTALL();
  18.      Image4->Visible = true;
  19.  
  20.    }
  21.    ProgressBar1->Position = 20;
  22.    Button2->Enabled = true;
  23.   }
  24.   ProgressBar1->StepBy(2);
  25. }