屏蔽复制文件对话框(20分)

  • 主题发起人 haisongzhang
  • 开始时间
H

haisongzhang

Unregistered / Unconfirmed
GUEST, unregistred user!
在windows下,复制文件夹,系统会显示一个窗口,内容是指明源文件夹和目标文件夹,<br>和一个复制的进度条,怎样把这个窗口屏蔽掉?<br>能否只显示进度条?
 
》一个复制的进度条,怎样把这个窗口屏蔽掉?<br>uses ShellApi;<br><br>function CopyFile(SourceName, TargetName: string): Boolean;<br>var<br>&nbsp; F: TShFileOpStruct;<br>begin<br>&nbsp; F.wnd := Form1.Handle;<br>&nbsp; F.wFunc := FO_COPY; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {操作方式}<br>&nbsp; F.pFrom := PChar(SourceName + #0#0);<br>&nbsp; F.pTo := PChar(TargetName + #0#0);<br>&nbsp; F.fFlags := FOF_SILENT ;<br>&nbsp; result := ShFileOperation(F) = 0;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br>&nbsp; CopyFile('E:/Temp', 'E:/Tmp');<br>end;<br><br>》能否只显示进度条?<br>使用回调函数似乎可以,但是没有试验过,就是说自己建立一个窗口来显示进度。<br>也许可能,只能这样说。<br><br>当然,如果你自己写复制函数,当然就可以了。
 
接受答案了.
 
顶部