如何删除回收站里的文件?(50分)

  • 主题发起人 主题发起人 飞来石
  • 开始时间 开始时间

飞来石

Unregistered / Unconfirmed
GUEST, unregistred user!
如何删除回收站里的文件?
 
你对这个过程试试吧!
//*****************************************************
procedure EmptyRecycleBin;
const
SHERB_NOCONFIRMATION = $00000001;
SHERB_NOPROGRESSUI = $00000002;
SHERB_NOSOUND = $00000004;
type
TSHEmptyRecycleBin =function(wnd :HWnd;LPCTStr :PChar;
DWORD :Word):integer;stdcall;
var
SHEmptyRecycleBin :TSHEmptyRecycleBin;
LibHandle :THandle;
begin
LibHandle :=LoadLibrary(PChar('Shell32.dll'));
try
if LibHandle <> 0 then
@SHEmptyRecycleBin :=GetProcAddress(LibHandle,PChar('SHEmptyRecycleBinA'))
else
begin
ShowMessage('不能加载Shell32动态链结库');
Exit;
end;
if @SHEmptyRecyclebin<>nil then
SHEmptyRecycleBin(Application.Handle,'',SHERB_NOCONFIRMATION or
SHERB_NOPROGRESSUI or SHERB_NOSOUND);
finally
FreeLibrary(LibHandle);
@SHEmptyRecycleBin :=nil;
end;
//****************************************************************************


如果还有什么问题可与我联系!
 
接受答案了.
 
后退
顶部