Autor Beitrag
Hellcode
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 19

WinXP SP2
D7 Ent
BeitragVerfasst: So 09.10.05 19:25 
Hallo, weiss jemand, wie man eine eigene Fortschrittsanzeige (TProgressbar) mit dieser Kopierfunktion benutzen kann:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
function CopySourceToTarget(const ASource, ADest: String;
 ARenameCheck: boolean = false): boolean;
var
  sh: TSHFileOpStruct;
begin
  sh.Wnd := Application.Handle;
  sh.wFunc := FO_COPY;

  // String muss mit #0#0 Terminiert werden, um das Listenende zu setzen
  sh.pFrom := PChar(ASource + #0);
  sh.pTo := PChar(ADest + #0);
  sh.fFlags := fof_Silent or fof_MultiDestFiles;
  if ARenameCheck then
    sh.fFlags := sh.fFlags or fof_RenameOnCollision;
  Result:=ShFileOperation(sh)=0;
end;


Den Standard-Dialog möchte ich nicht benutzen. Und andere Kopiermethoden (CopyFile, TStream, ...) haben sich allesamt auf irgendeine Art und Weise als Nachteilig herausgestellt. Hat jemand eine Idee?
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 09.10.05 23:23 
Gar nicht. Die Funktion bietet keine Schnittstelle zu einer Callback Funktion, die man selber bestimmen könnte.
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Mo 10.10.05 07:30 
Es gibt irgendeine Copy-Funktion der WinApi die ne Callback funktion bietet.
Einfach mal in MSDN nach CopyFile suchen. Dort müsste ein Verweis stehen.
Hellcode Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 19

WinXP SP2
D7 Ent
BeitragVerfasst: Mo 10.10.05 08:09 
Danke für eure Hilfe!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 10.10.05 13:52