悟 悟空 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-04 #1 各位Delphi们请指教,如何用代码清空或还原回收站的东西??<br>(初到贵竟,先收下80大元吧!)
H hubdog Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-04 #2 清空是用这个函数,还原我也不知道,你问o*o吧<br>SHEmptyRecycleBin
L Li zhaoyang Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-04 #3 <br>uses ShellApi;<br>{ 利用ShellApi中: function SHFileOperation(const lpFileOp: TSHFileOpStruct): Integer; stdcall; }<br><br>Var T:TSHFileOpStruct;<br>P:String;<br>begin<br>P:='C:/Windows/System/EL_CONTROL.CPL';<br>With T do<br>Begin<br>Wnd:=0;<br>wFunc:=FO_DELETE;<br>pFrom:=Pchar(P);<br>fFlags:=FOF_ALLOWUNDO //这里一定要这样设置;<br>End;<br>SHFileOperation(T);<br>End.<br>
<br>uses ShellApi;<br>{ 利用ShellApi中: function SHFileOperation(const lpFileOp: TSHFileOpStruct): Integer; stdcall; }<br><br>Var T:TSHFileOpStruct;<br>P:String;<br>begin<br>P:='C:/Windows/System/EL_CONTROL.CPL';<br>With T do<br>Begin<br>Wnd:=0;<br>wFunc:=FO_DELETE;<br>pFrom:=Pchar(P);<br>fFlags:=FOF_ALLOWUNDO //这里一定要这样设置;<br>End;<br>SHFileOperation(T);<br>End.<br>
L Li zhaoyang Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-04 #4 补充:<br>给出文件的绝对路径名,否则可能不能恢复<br>
悟 悟空 Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-04 #5 谢谢大兄们的关照,但我需要的不仅是清空回收站, 最需要的是还原回收站.<br>Li zhaoyang兄, 我怎么运行您的程序时, 程序只管把文件往回收站里塞?