Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

RecycleBinItems - Get info on the items in the Recycle Bin
[ All Languages » VB »  Windows]

Total Hit ( 2013)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


Click here to copy the following block
Option Explicit

Private Type SHQUERYRBINFO
  cbSize As Long      ' bytes in this structure
  i64Size As Currency   ' 64-bit integer with size of items in the Recycle
               ' Bin
  i64NumItems As Currency  ' 64-bit integer with number of items in the
               ' Recycle Bin
End Type

Private Declare Function SHQueryRecycleBin Lib "shell32.dll" Alias _
  "SHQueryRecycleBinA" (ByVal pszRootPath As String, _
  QueryInfo As SHQUERYRBINFO) As Long

' Return number of items in the Recycle Bin for the
' specified drive, or all drives if the argument is
' a null string
'
' If you pass a second argument, it is filled with the
' total size of the items in the Recycle Bin for that drive

Function RecycleBinItems(ByVal RootPath As String, _
  Optional NumBytes As Currency) As Long
  Dim qInfo As SHQUERYRBINFO

  ' add a colon and backslash, if missing
  If Len(RootPath) > 0 And Mid$(RootPath, 2, 2) <> ":\" Then
    RootPath = Left$(RootPath, 1) & ":\"
  End If
  qInfo.cbSize = Len(qInfo)
  Debug.Print SHQueryRecycleBin(RootPath, qInfo)
  ' scale up the result
  RecycleBinItems = qInfo.i64NumItems * 10000
  ' return the size in the second argument
  NumBytes = qInfo.i64Size * 10000
End Function


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.