using the following code to delete file to recycle bin does take a plenty of time if i delete a file by a file in large quantity (compare the method of deleting the files permanently).
Option Explicit
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As Long ' only used if FOF_SIMPLEPROGRESS
End Type
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Const FO_DELETE = &H3
Private Const FOF_ALLOWUNDO = &H40
Private Sub CmdDelete_Click()
Dim op As SHFILEOPSTRUCT
With op
.wFunc = FO_DELETE
.pFrom = FilenameText.Text
.fFlags = FOF_ALLOWUNDO
End With
SHFileOperation op
End Sub
Is there any method for me to speed up the deletion process to recycle bin
Thanks.