Einzelnen Beitrag anzeigen

hathor
(Gast)

n/a Beiträge
 
#6

Re: WinXP: Wie leert man den Papierkorb?

  Alt 17. Okt 2009, 22:36
Delphi-Quellcode:
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
    application.MessageBox('Failed to load Shell32.dll.','Notice',MB_OK);
    Exit;
  end;
  if @SHEmptyRecycleBin <> nil then
  SHEmptyRecycleBin(Application.Handle, '', SHERB_NOCONFIRMATION);
  FreeLibrary(LibHandle);
  @SHEmptyRecycleBin := nil;
end;
  Mit Zitat antworten Zitat