uses shellapi
...
function copydir(von,zieldir: String): boolean;
var fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do begin
wFunc := FO_COPY;
fFlags := FOF_FILESONLY;
pFrom := PChar(von+#0);
pTo := PChar(zieldir)
end;
Result:=(0=ShFileOperation(fos));
end;
function movedir(von,zieldir: String): boolean;
var fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do begin
wFunc := FO_MOVE;
fFlags := FOF_FILESONLY;
pFrom := PChar(von+#0);
pTo := PChar(zieldir)
end;
Result:=(0=ShFileOperation(fos));
end;
function deldir(dir: String): boolean;
var fos: TSHFileOpStruct;
begin
ZeroMemory(@fos, SizeOf(fos));
with fos do begin
wFunc := FO_DELETE;
fFlags := FOF_SILENT or FOF_NOCONFIRMATION;
pFrom := PChar(dir+#0);
end;
Result:=(0=ShFileOperation(fos));
end;
// Kullanimi:
procedure TForm1.Button1Click(Sender: TObject);
begin
{'D:\download' -> 'E:\'}
if copydir('d:\download','e:\') then
begin
ShowMessage('Kopyalama basarili');
end;