|
How
to empty the Recycle Bin within a VB-Application using
the API
Private Declare
Function SHEmptyRecycleBin Lib "shell32.dll"
Alias "SHEmptyRecycleBinA" (ByVal hwnd As
Long, ByVal pszRootPath As String, ByVal dwFlags As
Long) As Long
Private Const SHERB_NORMAL = &H0 'Normal execution
Private Const SHERB_NOCONFIRMATION = &H1 'execute
without confirmation
Private Const SHERB_NOPROGRESSUI = &H2 'execute
without progress window
Private Const SHERB_NOSOUND = &H4 'execute without
sound
Private Const SHERB_NOALL = (SHERB_NOCONFIRMATION And
SHERB_NOPROGRESSUI And SHERB_NOSOUND)
Dim RetVal As Long
Private Sub EmpRecBin()
RetVal = SHEmptyRecycleBin(0&,
vbNullString, SHERB_NORMAL)
End Sub
Tip submitted by Frank Leismann
|
|
|
|