|
-
May 1st, 2006, 05:30 AM
#1
Thread Starter
New Member
Empty Recycle bin by VB
Code to Empty Recycle bin by VB
VB Code:
Const SHERB_NOCONFIRMATION = &H1
Const SHERB_NOPROGRESSUI = &H2
Const SHERB_NOSOUND = &H4
Private Type ULARGE_INTEGER
LowPart As Long
HighPart As Long
End Type
Private Type SHQUERYRBINFO
cbSize As Long
i64Size As ULARGE_INTEGER
i64NumItems As ULARGE_INTEGER
End Type
Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal hwnd As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As Long
Private Declare Function SHUpdateRecycleBinIcon Lib "shell32.dll" () As Long
Private Declare Function SHQueryRecycleBin Lib "shell32.dll" Alias "SHQueryRecycleBinA" (ByVal pszRootPath As String, pSHQueryRBInfo As SHQUERYRBINFO) As Long
Private Sub Form_Load()
Dim RBinInfo As SHQUERYRBINFO, Msg As VbMsgBoxResult
RBinInfo.cbSize = Len(RBinInfo)
SHQueryRecycleBin vbNullString, RBinInfo
If (RBinInfo.i64Size.LowPart And &H80000000) = &H80000000 Or RBinInfo.i64Size.HighPart > 0 Then
Msg = MsgBox("Your Recycle Bin consumes over 2 gigabytes right now!" + vbCrLf + "Do you want to empty it?", vbYesNo + vbQuestion)
Else
Msg = MsgBox("Your Recycle Bin consumes" + Str$(RBinInfo.i64Size.LowPart) + " bytes right now." + vbCrLf + "Do you want to empty it?", vbYesNo + vbQuestion)
End If
If Msg = vbYes Then
SHEmptyRecycleBin Me.hwnd, vbNullString, 0
SHUpdateRecycleBinIcon
End If
End Sub
"THERE IS NO GOD EXCEPT ALLAH, AND MUHAMMED IS HIS MESSENGER "
Hany Saad Moustaffa .
Moderator of VB6.0 forum in Arabteam forums.
Egypt, Asyut.
Asyut university, faculty of science.
E-mail : [email protected]
My Blog : http://hanysaad.blogspot.com/
-
May 1st, 2006, 05:41 AM
#2
Fanatic Member
Re: Empty Recycle bin by VB
If you are going to post working code, please post it in the VB Codebank
-
May 1st, 2006, 07:16 AM
#3
Thread Starter
New Member
Re: Empty Recycle bin by VB
If you are going to post working code, please post it in the VB Codebank
I am sorry , i did not remark this code bank
thank you for your remark,,,
"THERE IS NO GOD EXCEPT ALLAH, AND MUHAMMED IS HIS MESSENGER "
Hany Saad Moustaffa .
Moderator of VB6.0 forum in Arabteam forums.
Egypt, Asyut.
Asyut university, faculty of science.
E-mail : [email protected]
My Blog : http://hanysaad.blogspot.com/
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|