你对这个过程试试吧!
//*****************************************************
procedure EmptyRecycleBin;
const
SHERB_NOCONFIRMATION = $00000001;
SHERB_NOPROGRESSUI = $00000002;
SHERB_NOSOUND = $00000004;
type
TSHEmptyRecycleBin =function(wnd :HWnd;LPCTStr
Char;
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;
//****************************************************************************
如果还有什么问题可与我联系!