function CopyProgress(
TotalFileSize : LARGE_INTEGER; // total file size, in bytes
TotalBytesTransferred : LARGE_INTEGER; // total number of bytes transferred
StreamSize : LARGE_INTEGER; // total number of bytes for this stream
StreamBytesTransferred: LARGE_INTEGER; // total number of bytes transferred for this stream
dwStreamNumber : DWORD; // the current stream
dwCallbackReason : DWORD; // reason for callback
hSourceFile : THANDLE; // handle to the source file
hDestinationFile : THANDLE; // handle to the destination file
lpData : Pointer // passed by CopyFileEx
) : DWORD; stdcall;
begin
Form1.ProgressBar1.Position := Form1.ProgressBar1.Position+1;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
Cancel : Bool;
Src, Dest : String;
hf : HFile;
ofs : OFSTRUCT;
size : Cardinal;
begin
Cancel := False;
Src := 'j:\[大富翁论坛离线资料].DelphiBBSchm.rar';
Dest:= 'e:.rar';
hf := OpenFile(PChar(src), ofs, 0);
size := GetFileSize(hf, nil);
self.ProgressBar1.Max := (size shr 16)+2;
self.ProgressBar1.Position := 0; !--判断阅读权限-->!--判断是否已经扣点--> |