我现在执行copyFile,
请问TProgressbar怎样成比例增加直至复制完成,
并显示0%到复制完后显示100%
象windows复制文件一样
请问TProgressbar怎样成比例增加直至复制完成,
并显示0%到复制完后显示100%
象windows复制文件一样
解决方案 »
- 一个DELPHI编译的程序,如何以网页的形式来展示??
- 请教数组的问题
- delphi读取txt内容并按顺序执行脚本内容
- 由于工作忙,很久不来这里了,,,有一年了吧,以后可能会偶尔来一下,请大家支持!!!
- ListView的简单问题,向各位请教,谢谢!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- DELPHI怎么实现普通text/html表单?
- 大家来帮忙!!
- 如何修改注册表,还加一个很难的注册表问题!
- VB老手,Delphi菜鸟,初级问题请关注?
- 请回答我的ADO方面问题啊,还是不会啊,急等谢谢.我在用SQL server建一个数据库为:mei331后,我用ADOconnection来连,可出来错误了请看
- 【散分】教个朋友!聊Delphi的,不管MSN/QQ/Yahoo!Messger/POPO/IMU
- 我的delphi上面的那一部分都不见了!就是打开delphi后,上面有File,Edit,Search,View,Project,Run,Component,Database,Tools,Help的这个
//拷贝过程会自动调用windows拷贝文件的进度窗口
//仅供参考uses shellapi, INIFiles;var
OpStruc: TSHFileOpStruct;
frombuf, tobuf: Array [0..255] of Char;
iniFile: TIniFile;
sSource, sDestination: String;
Begin
iniFile := TIniFile.Create('.\Settings.ini');
try
Application.ProcessMessages; sSource := iniFile.ReadString('Paths', 'Source', '');
sDestination := iniFile.ReadString('Paths', 'Destination', '');
if (not DirectoryExists(sSource))
or (not DirectoryExists(sDestination)) then
Abort; if (iniFile.ReadInteger('Paths', 'CreateNewDir', 1) = 1) then
begin
sDestination := sDestination + '\' +
StringReplace(FormatDateTime('yyyy-mm-dd, hh:mm', Now), ':', ':', [rfReplaceAll]);
if (not CreateDir(sDestination)) then
Abort;
end; FillChar(frombuf, Sizeof(frombuf), 0);
FillChar(tobuf, Sizeof(tobuf), 0);
StrPCopy(frombuf, sSource + '\*.*');
StrPCopy(tobuf, sDestination);
With OpStruc DO Begin
Wnd := Handle;
wFunc := FO_COPY;
pFrom := @frombuf;
pTo := @tobuf;
fFlags := FOF_NOCONFIRMATION or FOF_RENAMEONCOLLISION;
fAnyOperationsAborted := False;
hNameMappings := Nil;
lpszProgressTitle := Nil;
end;
ShFileOperation(OpStruc);
finally
iniFile.Free;
FCanClose := True;
Self.Close;
end;
end;
Sample 版面 上 TGauge有,看你需要...
CopyFileEx(),CopyProgressRoutine()用 CopyFile 无法得知文件复制的进度。