Bonjour a tout le monde

J'ai un petit problème sur une procedure

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
procedure Copier( source, dest : string);
begin
     i :=0;
     r := FindFirst(source+'*.*', FaAnyFile, DirInfo);
     while r=0 do
     begin
         if (DirInfo.Attr and faArchive > 0) then
         inc(i);
         r := FindNext(DirInfo);
       end;
     FindClose(DirInfo);
 
        r := FindFirst(source+'*.*', FaAnyFile, DirInfo);
     while r=0 do
     begin
        if (DirInfo.Attr and faArchive > 0) then
          begin
 
               Application.ProcessMessages;
               source2 := source+DirInfo.Name;
               dest2 := dest+DirInfo.Name;
              form1.label9.caption:=source2;
               CopyFile( pchar(source2) , pchar(dest2), false);
                   end;
                r := FindNext(DirInfo);
       form1.progressbar1.position:=form1.progressbar1.position+i+1;
           end;
     FindClose(DirInfo);
            r := FindFirst(source+'*.*', FaAnyFile, DirInfo);
          while r=0 do
     begin
          if (DirInfo.Attr and FaDirectory <> 0) then
             if ((DirInfo.Name <> '.') and (DirInfo.Name <> '..')) then
             begin
                CreateDir(dest+DirInfo.Name+'\');
                Copier(source+DirInfo.Name+'\', dest+DirInfo.Name+'\');
                 end;
          r := FindNext(DirInfo);
          Application.ProcessMessages;
             end;
           FindClose(DirInfo);
         form1.label9.caption:= source2;
        form1.progressbar1.position:= 0;
      end;
lors de la copie d'un répertoire cela fonctionne a merveille mais par contre
sur ma form j'ai 3 bouton avec 3 chemins différents et autant de progressbars
dois réécrire cette procedure en modifiant (progressbar1, par progressbar2) ou peut on modifier cette
procedure pour obtenir par exemple copier('source','destination',progressbar(x)) ???

je débute soyez indulgents: oops: