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_YESNO) = ID_YES then 
       SHEmptyRecycleBinA(Application.Handle,'', $7); 
  except 
    Result:=false; 
  end
end;
上一篇:[工作中的设计模式]责任链模式chain


下一篇:函数参数选项的处理getopt getopt_long getopt_long_only