EmptyRecycle() 清空回收站

//在uses下面引用
function SHEmptyRecycleBinA(Wnd:HWND;str:PChar;WRD:DWORD):Integer;stdcall; external 'SHell32.dll';
 
{清空回收站}

//调用 EmptyRecycle();

function EmptyRecycle():boolean
begin 
  Result:=true
  try 
    if Application.MessageBox('确定要清空回收站吗?','提示',MB_YESNOID_YES then 
       SHEmptyRecycleBinA(Application.Handle,''$7); 
  except 
    Result:=false
  end
end;
原文地址:https://www.cnblogs.com/yzryc/p/6142102.html