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
MessageDlg('Failed to load Shell32.dll.', mtError, [mbOK], 0);
Exit ;
End ;
If @SHEmptyRecycleBin <> nil then
SHEmptyRecycleBin(Application.Handle ,
'' ,
SHERB_NOCONFIRMATION or
SHERB_NOPROGRESSUI or
SHERB_NOSOUND ) ;
FreeLibrary(LibHandle);
@SHEmptyRecycleBin := nil ;
End ;
清空回收站
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章