Bonjour à tous
Ici, un exemple de paramétrage en dynamique, et non à travers l'inspecteur d'objets.
Là, je plante :
Avec le JvSHFileOPertations, je peux m'y prendre comme ça :
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 Function Thrd_Lister_Rep_Dyn ( lpParam : Pointer ) : LongWord ; stdcall ; Var JvSearch : TJvSearchFiles; i : integer; Options_Dir : TJvDirOption; Options_SearchType : TJvSearchOption; Ptr_Lst_F : ^TStringList; Ptr_Lst_Rep : ^TStringList; Options_Search : TJvSearchOption; begin Param_Listage_Rep.Nb_F := 0; Param_Listage_Rep.Nb_Rep := 0; Param_Listage_Rep.Surface := 0; if AnsiCompareText(Param_Listage_Rep.Masque_Rech, '') = 0 then begin Param_Listage_Rep.Err := 1; // Masque de recherche est une chaîne vide ExitThread(0); Exit; end; If DirectoryExists(Param_Listage_Rep.Rep_Cible) = False then begin Param_Listage_Rep.Err := 2; // Rep_Cible n'existe pas ExitThread(0); Exit; end; Param_Listage_Rep.Nb_F := 0; Param_Listage_Rep.Nb_Rep := 0; Param_Listage_Rep.Surface := 0; JvSearch := TJvSearchFiles.Create(Nil); // PARAMETRAGE DU JvSearchFiles ------------------ JvSearch.FileParams.FileMask := Param_Listage_Rep.Masque_Rech; JvSearch.RootDirectory := Param_Listage_Rep.Rep_Cible; // Ici : le compilo ne laisse pas passer : Options_SearchType := soAllowDuplicates OR soCheckRootDirValid OR soOwnerData OR soSearchDirs OR soSearchFiles OR soIncludeSystemHiddenDirs OR soIncludeSystemHiddenFiles; if Param_Listage_Rep.Racine_Seule = True then begin JvSearch.DirOption := doExcludeSubDirs; end; JvSearch.Search; Param_Listage_Rep.Nb_F := JvSearch.TotalFiles; Param_Listage_Rep.Nb_Rep := JvSearch.TotalDirectories; Param_Listage_Rep.Surface := JvSearch.TotalFileSize; for i := 0 to JvSearch.TotalDirectories -1 do begin Param_Listage_Rep.Lst_R.Add(JvSearch.Directories.Strings[i]); end; for i := 0 to JvSearch.TotalFiles -1 do begin Param_Listage_Rep.Lst_F.Add(JvSearch.Files.Strings[i]); end; JvSearch.Free; ExitThread(0); end;
C'est le paramétrage du TJvSearchFiles qui me pose problème au niveau des options. Include ne passe pas.
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 Procedure Appel_JvSHF; Var Jv_SHF : TJvSHFileOperation; Options_SHF : TJvSHFileOptions; begin Jv_SHF := TJvSHFileOperation.Create(Nil); // Include(Options,fofAllowUndo); // Si activé, déplace ds la corbeille Include(Options_SHF,fofMultiDestFiles); Include(Options_SHF,fofNoConfirmation); Include(Options_SHF,fofNoConfirmMkDir); Include(Options_SHF,fofSilent); Include(Options_SHF,fofWantMappingHandle); Include(Options_SHF,fofNoErrorUI); Include(Options_SHF,fofRenameOnCollision); // Désactivé Include(Options_SHF,fofNoRecursion); Include(Options_SHF,fofNoConnectedElements); Include(Options_SHF,fofNoRecurseParse); Include(Options_SHF,fofWantNukeWarning); Jv_SHF.Options := Options_SHF; Jv_SHF.SourceFiles.Add('D:\ALPHA3'); ForceDirectories('D:\TEST\ALPHA'); Jv_SHF.DestFiles.Add('D:\TEST\ALPHA'); Jv_SHF.Operation := foCopy; Jv_SHF.Execute; Jv_SHF.Free; end;
Partager