{=================================================================
 功  能:  清空回收站
 叁  数:  无
 返回值:  无
=================================================================}
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'));
 if LibHandle <> 0 then
   @SHEmptyRecycleBin := GetProcAddress(LibHandle, 'SHEmptyRecycleBinA')
 else  begin
   MsgBox('Failed to load Shell32.dll.', mtError, [mbOK]);
   Exit;
 end;
 if @SHEmptyRecycleBin <> nil then
   SHEmptyRecycleBin(Application.Handle,'',SHERB_NOCONFIRMATION or  SHERB_NOPROGRESSUI or SHERB_NOSOUND);
 FreeLibrary(LibHandle);
 @SHEmptyRecycleBin := nil;
end;

最后修改:2009 年 08 月 16 日 12 : 30 PM