Thanks for help.
For both those operations, I would use the ShFileOperation API function.
It's documented on MSDN, and there are many examples on the Web and in
the newsgroup archives.
--
Rob
> i know how to delete the whole directory , how about copy the whole
> directory ?
SHFileOperation
--
With best regards, Slava
http://slava.users.otts.ru
USES ShellAPI;
function TForm1.CopyFileOrFolder(Source, Destination : string) :
Boolean;
var
SHFileOp : TSHFileOpStruct;
Error : Integer;
Aborted : Boolean;
begin
FillChar(SHFileOp,SizeOf(SHFileOp),0);
SHFileOp.Wnd:= Handle;
SHFileOp.wFunc:= FO_COPY;
SHFileOp.pFrom:= PChar(Source + #0);
SHFileOp.pTo:= PChar(Destination +#0);
SHFileOp.fFlags:= FOF_ALLOWUNDO;
//fFlags := FOF_ALLOWUNO or FOF_SIMPLEPROGRESS;
Error:= SHFileOperation(SHFileOp);
Aborted:= (Error = 117);
if Aborted then Error:= 0;
Result:= (Error = 0) and not Aborted;
end;
--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia
"David" <da...@fd.com> 撰寫於郵件新聞
:4118b730$1...@newsgroups.borland.com...