Bonjour
j'ai une fonction dans mon programme qui m’empêche de supprimer des dossier
comment l'activer et la desactiver ?

voici la fonction
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
 
void scan_dir3(char Rep[], TTreeNode *p)
{
	char CopieRep[1000];
	lstrcpy(CopieRep, Rep);
	WIN32_FIND_DATA fd;
        String asFic;
        String asFic2;
	char Nom[1000]="";
        int z;
	lstrcpy(Nom, CopieRep);
        lstrcat(Nom, "*.*");
	HANDLE h = FindFirstFile(Nom, &fd);
        bool res = true;
	bool FirstFile=false;
 
	if (h!=INVALID_HANDLE_VALUE)
        {
			while (res && !Stopper)
                        {
                                 // Routine de memorisation des fichiers + chemin
				asFic2=(fd.cFileName);
                                 asFic=(Nom);
                                 if  (asFic2!="." )
                                 {
						if (asFic2!="..")
                                                {
                                                        asFic=asFic.SubString(1, asFic.Length()-3);// Supprime *.*
                                                        if (asFic2.Pos("*.*")==0)
                                                        {
								if (imgPath == "")
                                                                 {
                                                                       tp=(asFic+asFic2);
                                                                       fil=ExtractFileName(tp);
									if (fil==VarDansBoucleDeRecherche)
									{
										imgPath=ExtractFilePath(tp);
                                                                         }
                                                                   }
                                                             }
							}
                                           }
                                           asFic="";
                                           asFic2="";
					   if (lstrcmp(fd.cFileName, "..") && lstrcmp(fd.cFileName, "."))
                                           {
                                                if (fd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
                                                {// Traitement de répertoire
							nbRep++;
                                                        char N[1000];
                                                        lstrcpy(N, CopieRep); lstrcat(N, fd.cFileName);
                                                        lstrcat(N, "\\");
						        if (FirstFile)
                                                        {
                                                              FirstFile = false;
                                                         }
							 else
                                                         scan_dir3(N, p);
                                                } 
                                                else
						{
                                                       nbFiles++;
                                                       if (FirstFile)
                                                       {
					                    FirstFile = false;
                                                        }
                                                  }
                                       }
						res = FindNextFile(h, &fd);
                          }
           }
}
Merci