반응형
uses ShellApi;
function Copy_File(const Src, Dest: String): Boolean;
var
FData : TSHFileOpStruct;
FFrom, FTo: String;
begin
FFrom := FileOperatorValue(Src);
FTo := FileOperatorValue(Dest);
FData.fFlags := FOF_ALLOWUNDO OR FOF_NOCONFIRMMKDIR;
FData.lpszProgressTitle := PChar( 'File Operation' );
FData.pFrom := PChar( FFrom );
FData.pTo := PChar( FTo );
FData.Wnd := 0;
FData.wFunc := FO_COPY;
Result := ShFileOperation( FData ) = 0;
end;
function Copy_File(const Src, Dest: String): Boolean;
var
FData : TSHFileOpStruct;
FFrom, FTo: String;
begin
FFrom := FileOperatorValue(Src);
FTo := FileOperatorValue(Dest);
FData.fFlags := FOF_ALLOWUNDO OR FOF_NOCONFIRMMKDIR;
FData.lpszProgressTitle := PChar( 'File Operation' );
FData.pFrom := PChar( FFrom );
FData.pTo := PChar( FTo );
FData.Wnd := 0;
FData.wFunc := FO_COPY;
Result := ShFileOperation( FData ) = 0;
end;
반응형