Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As Long
SHEmptyRecycleBin deletes the contents of the Recycle Bin, displaying dialog boxes as desired. The function can empty the Recycle Bin of a particular drive, or it can empty all Recycle Bins as a whole.
If an error occured, the function returns a non-zero error code. If successful, the function returns 0.
None.
Const SHERB_NOCONFIRMATION = &H1
Const SHERB_NOPROGRESSUI = &H2
Const SHERB_NOSOUND = &H4
' This code is licensed according to the terms and conditions listed here.
' Delete the contents in the system's Recycle Bin, without
' showing the progress dialog. If an error occurs, be safe and
' make sure the proper Recyle Bin icon is used.
Dim retval As Long ' return value
' Delete the contents of the system's Recycle Bin, if the user OKs it.
retval = SHEmptyRecycleBin(Form1.hWnd, "", SHERB_NOPROGRESSUI)
' If an error occured, be overly save and refresh the Recycle Bin
' icon. This probably isn't necessary, however.
If retval <> 0 Then ' error
retval = SHUpdateRecycleBinIcon()
End If
SHQueryRecycleBin, SHUpdateRecycleBinIcon
Go back to the alphabetical Function listing.
Go back to the Reference section index.
Last Modified: September 1, 1999
This page is copyright © 1999 Paul Kuliniewicz.
Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/s/shemptyrecyclebin.html