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

  FORUM HardWare.fr
  Programmation

  multitache

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

multitache

n°56126
la viper
Posté le 29-08-2001 à 16:45:41  profilanswer
 

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 ?

mood
Publicité
Posté le 29-08-2001 à 16:45:41  profilanswer
 

n°56127
la viper
Posté le 29-08-2001 à 16:47:21  profilanswer
 

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

n°56128
la viper
Posté le 29-08-2001 à 16:48:47  profilanswer
 

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();
 }
}


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  multitache

 

Sujets relatifs
[VB] Problème de "multitache" 
Plus de sujets relatifs à : multitache


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