BOOL CopyFile( LPCTSTR lpExistingFileName, // pointer to name of an existing file
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
LPCTSTR lpNewFileName, // pointer to filename to copy to
BOOL bFailIfExists // flag for operation if file exists
);
{copy整个目录 }
{ ----------------------------------------------------- }
function CopyDir(FromDir, ToDir: string): boolean;
var T : TSHFileOpStruct;
begin
With T do
Begin
Wnd:=Application.Handle;
wFunc:=FO_COPY ;
pFrom:=Pchar(FromDir);
pTo:=pchar(ToDir);
hNameMappings:=nil;
lpszProgressTitle:=nil;
fFlags:=FOF_NOCONFIRMATION;
End;
SHFileOperation(T);
result := true;
end;