1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
LPVOID lpMsgBuf;
DWORD dwLastError;
if(!TreeView_DeleteAllItems(treeViewFlux))
printf("ca marche pas\n");
SetCurrentDirectory("C:\\Documents and Settings\\imaj8504\\Desktop\\etherealplayer\\Debug\\etherealFiles");
temp = threadNumber;
//initialisationListeFlux();
for(int i = 0; i < temp/*threadNumber*/; i++)
{
if(/*graphManager[i]*/ hThreads[i].graphManager!= NULL)
{
/*graphManager[i]*/hThreads[i].graphManager->ClearGraph();
delete hThreads[i].graphManager/*graphManager[i]*/;
/*graphManager[i]*/hThreads[i].graphManager = NULL;
printf("on est ds le for\n");
if(!TerminateThread(hThreads[i].thread, 0))
MessageBox(hwnd,"Impossible de terminer le thread", Message",MB_ICONQUESTION);
char nomFichier[260];
if(!DeleteFile(hThreads[i].nomflux))
{
sprintf(nomFichier, "Impossible de supprimer le fichier %s", (hThreads[i].nomflux));
MessageBox(hwnd,nomFichier, "Message",MB_ICONQUESTION);
}
else
{
MessageBox(hwnd,"Fichier supprimé", "Message",MB_ICONQUESTION);
printf("on a supprimé %s\n", hThreads[i].nomflux);
}
dwLastError = GetLastError();
FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
dwLastError,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL );
MessageBox(hwnd,(LPCTSTR) lpMsgBuf, "Message",MB_ICONQUESTION);
LocalFree(lpMsgBuf);
}
}
DestroyWindow(hwnd);
PostQuitMessage(0);
return 0;
|
Partager