我想在删除目录的时候不显示进度条,该怎么做?该目录下有很多临时小文件,看了心烦。(100分)

  • 主题发起人 主题发起人 sakura12
  • 开始时间 开始时间
S

sakura12

Unregistered / Unconfirmed
GUEST, unregistred user!
我想在删除目录的时候不显示进度条,该怎么做?该目录下有很多临时小文件,看了心烦。
 
用WinExec调用Dos下的目录删除程序DelTree试试看.
 
你可以自己编程来实现删除文件夹,而不用利用WINDOWS的删除功能!<br>这样你就可以除掉进度条了。<br><br>uses ShellAPI;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var<br>&nbsp; FileOpStruct :TSHFileOpStruct;<br>&nbsp; Buf1 :array [0..127] of Char;<br>&nbsp; Buf2 :array [0..127] of Char;<br>&nbsp; Str1,Str2 :String;<br>begin<br>&nbsp; Str1 :='c:/tyn1';<br>&nbsp; Str2 :='c:/tyn2';<br>&nbsp; FillChar(Buf1,SizeOf(Buf1),0);<br>&nbsp; FillChar(Buf2,SizeOf(Buf2),0);<br>&nbsp; StrPCopy(Buf1,Str1);<br>&nbsp; StrPCopy(Buf2,Str2);<br>&nbsp; with FileOpStruct do<br>&nbsp; begin<br>&nbsp; &nbsp; Wnd :=Handle;<br>&nbsp; &nbsp; case (Sender as TButton).tag of<br>&nbsp; &nbsp; &nbsp; 1 : wFunc :=FO_COPY;<br>&nbsp; &nbsp; &nbsp; 2 : wFunc :=FO_DELETE;<br>&nbsp; &nbsp; &nbsp; 3 : wFunc :=FO_Move;<br>&nbsp; &nbsp; &nbsp; 4 : wFunc :=FO_RENAME;<br>&nbsp; &nbsp; end;<br>&nbsp; &nbsp; pFrom :=@Buf1;<br>&nbsp; &nbsp; pTo :=@Buf2;<br>&nbsp; &nbsp; fFlags :=FOF_SIMPLEPROGRESS; &nbsp;//去掉这条语句就可以不显示进度条<br>&nbsp; &nbsp; fAnyOperationsAborted :=False;<br>&nbsp; &nbsp; hNameMappings :=nil;<br>&nbsp; &nbsp; case (Sender as TButton).tag of<br>&nbsp; &nbsp; &nbsp; 1 : lpszProgressTitle :='拷贝文件';<br>&nbsp; &nbsp; &nbsp; 2 : lpszProgressTitle :='删除文件';<br>&nbsp; &nbsp; &nbsp; 3 : lpszProgressTitle :='移动文件';<br>&nbsp; &nbsp; &nbsp; 4 : lpszProgressTitle :='文件重命名';<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>&nbsp; SHFileOperation(FileOpStruct);<br>end;<br><br>
 
接受答案了.
 

Similar threads

回复
0
查看
804
不得闲
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
后退
顶部