Author: Senn Marco How to empty the recycle bin Answer: 1 procedure EmptyRecycleBin; 2 const 3 SHERB_NOCONFIRMATION = $00000001; 4 SHERB_NOPROGRESSUI = $00000002; 5 SHERB_NOSOUND = $00000004; 6 type 7 TSHEmptyRecycleBin = function(Wnd: HWND; pszRootPath: pChar; dwFlags: DWORD): 8 HRESULT; stdcall; 9 var 10 SHEmptyRecycleBin: TSHEmptyRecycleBin; 11 LibHandle: THandle; 12 begin 13 LibHandle := LoadLibrary(pChar('Shell32.dll')); 14 if LibHandle <> 0 then 15 @SHEmptyRecycleBin := GetProcAddress(LibHandle, 'SHEmptyRecycleBinA'); 16 if @SHEmptyRecycleBin <> nil then 17 begin 18 SHEmptyRecycleBin(Application.Handle, nil, SHERB_NOCONFIRMATION or 19 SHERB_NOPROGRESSUI or SHERB_NOSOUND); 20 end; 21 FreeLibrary(LibHandle); 22 @SHEmptyRecycleBin := nil; 23 end;