Mega Code Archive

 
Categories / Delphi / System
 

Empty RecycleBin

Title: Empty RecycleBin Try something like this. procedure TForm1.Button1Click(Sender: TObject); type TEmptyBin=function(Wnd: hWnd; LpctStr: PChar; DWord: Word): Integer; stdcall; var MyHandle: THandle; RecBin: TEmptyBin; begin MyHandle:=LoadLibrary('Shell32.dll'); @RecBin:=GetProcAddress(MyHandle, 'SHEmptyRecycleBinA'); RecBin(Application.Handle, '', 0); FreeLibrary(MyHandle); @RecBin:=nil; end;