VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, prog

by M. Jahedbozorgan (1 Submission)
Category: Windows API Call/Explanation
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sat 10th November 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, progress dialog, and sounds.

API Declarations


' Deletes all files in the Recycle Bin for the specified
' drive.
' If drive be omitted, it affects the Recycle Bin of all
' drives. You can optionally turn off confirmation dialogs,
' progress dialog, and sounds.

Option Explicit

Private Declare Function SHEmptyRecycleBin Lib "shell32.dll" Alias "SHEmptyRecycleBinA" (ByVal HWnd As Long, ByVal pszRootPath As String, ByVal dwFlags As Long) As Long

Rate Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, prog



 Dim HWnd, Flags As Long
 On Error Resume Next
 HWnd = Screen.ActiveForm.HWnd
 If Len(Drive) > 0 Then _
  Drive = Left$(Drive, 1) & ":\"
 Flags = (NoConfirmation And &H1) Or (NoProgress And &H2) Or (NoSound And &H4)
 SHEmptyRecycleBin HWnd, Drive, Flags
End Sub

' Jahedsoft - The VB Source Code Site
' http://www.geocities.com/m_jahedbozorgan/
[email protected]

Download this snippet    Add to My Saved Code

Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, prog Comments

No comments have been posted about Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, prog. Why not be the first to post a comment about Empty Recycle Bin for a drive or all drives! You can optionally turn off confirmation dialogs, prog.

Post your comment

Subject:
Message:
0/1000 characters