Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2815 connectés 

 


Dernière réponse
Sujet : multitache
la viper void CShutDownDlg::Launch()
{
 int iValue = AfxMessageBox("Attention !\n l'ordinateur s'eteindra à la fin de l'application\n\n Voulez-vous continuer ?", MB_YESNO, 0 );
 
 if (iValue == IDYES )
 {
  STARTUPINFO sui ;
  PROCESS_INFORMATION pi ;
  sui.cb = sizeof (STARTUPINFO);
  GetStartupInfo (&sui);
  sui.dwFlags = STARTF_USESHOWWINDOW ;
  sui.wShowWindow = SW_MINIMIZE ;
   
  // Creation du process
  CreateProcess (m_Path,
   NULL,
   NULL,
   NULL,
   FALSE,
   CREATE_DEFAULT_ERROR_MODE|HIGH_PRIORITY_CLASS,
   NULL,
   NULL,&sui,&pi);
   
  m_PID = pi.dwProcessId;
 
  UpdateData(FALSE);
 
  ShowWindow(SW_HIDE);
 
  // Attente de la fin du process fils
  WaitForSingleObject(pi.hProcess, INFINITE);
   
  Exit();
 }
}

Votre réponse
Nom d'utilisateur    Pour poster, vous devez être inscrit sur ce forum .... si ce n'est pas le cas, cliquez ici !
Le ton de votre message                        
                       
Votre réponse


[b][i][u][strike][spoiler][fixed][cpp][url][email][img][*]   
 
   [quote]
 

Options

 
Vous avez perdu votre mot de passe ?


Vue Rapide de la discussion
la viper void CShutDownDlg::Launch()
{
 int iValue = AfxMessageBox("Attention !\n l'ordinateur s'eteindra à la fin de l'application\n\n Voulez-vous continuer ?", MB_YESNO, 0 );
 
 if (iValue == IDYES )
 {
  STARTUPINFO sui ;
  PROCESS_INFORMATION pi ;
  sui.cb = sizeof (STARTUPINFO);
  GetStartupInfo (&sui);
  sui.dwFlags = STARTF_USESHOWWINDOW ;
  sui.wShowWindow = SW_MINIMIZE ;
   
  // Creation du process
  CreateProcess (m_Path,
   NULL,
   NULL,
   NULL,
   FALSE,
   CREATE_DEFAULT_ERROR_MODE|HIGH_PRIORITY_CLASS,
   NULL,
   NULL,&sui,&pi);
   
  m_PID = pi.dwProcessId;
 
  UpdateData(FALSE);
 
  ShowWindow(SW_HIDE);
 
  // Attente de la fin du process fils
  WaitForSingleObject(pi.hProcess, INFINITE);
   
  Exit();
 }
}
la viper mon code :
 
voici mon code :  
void CShutDownDlg::OnOpen()  
{
 // TODO: Add your control notification handler code here
 CFileDialog *pFile;
 pFile = new CFileDialog(TRUE, "mdb", NULL, NULL, "Programmes|*.exe|Tous les fichiers|*.*||" );
 pFile->DoModal();
 m_Path = pFile->GetPathName();
 UpdateData(FALSE);
}
 
void CShutDownDlg::OnChangePath()  
{
 // TODO: If this is a RICHEDIT control, the control will not
 // send this notification unless you override the CDialog::OnInitDialog()
 // function and call CRichEditCtrl().SetEventMask()
 // with the ENM_CHANGE flag ORed into the mask.
 
 // TODO: Add your control notification handler code here
la viper voilà j'ai ecrit un programme qui lance des applications et qui eteint le pc une fois celle-ci terminée .. le truc fonctionne bien par contre j'ai l'impression que ca fonctionne pas avec toutes les applications.
 
je l'utilise essentiellement avec rippack. d'ou l'utilité d'eteindre le pc une fois terminé.
 
mais quand j'utilise mon programme avec le fichier .bat qui rippack crée, mon ordinateur reboot tout seul au bout d'une heure ou deux .. ou le processus s'arrete tout seul :-(
 
kk'un a-t-il deja rencontré ce type de probleme qq part?
est ce que j'utilise les bonnes commandes ?

Copyright © 1997-2025 Groupe LDLC (Signaler un contenu illicite / Données personnelles)