AllAPI Network - The KPD-Team

 
Allapi Network
 API-Guide
 ApiViewer

 API List

 
API Resources
 Tips & Tricks
 VB Tutorials
 Error Lookup
 
Misc Stuff
 VB examples
 VB Tools
 VB Links
 Top Downloads
 
This Site
 Search Engine
 Contact Form
 

Donate to AllAPI.net

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

 

 


Copyright © 1998-2007, The Mentalis.org Team - Privacy statement
Did you find a bug on this page? Tell us!
This site is located at http://allapi.mentalis.org/