This code demostrate how to send any file to the Recycle Bin using one api call.
This code demostrate how to send any file to the Recycle Bin using one api call.
API Declarations
Private Const ALLOWUNDO=&H40
Private Declare Function SHFileOperation _
Lib "Shell32.dll" _
(FileOp As SHFILEOPSTRUCT)As Long
Private Type SHFILEOPSTRUCT
hWnd As Long
lFunc As Long
sForm As String
sTo As String
iFlags As Integer
boolAnyOperationAborted As Boolean
lNameMappings As Long
sProgressTitle As String
End Type
Rate This code demostrate how to send any file to the Recycle Bin using one api call.
(1(1 Vote))
'code wrote by Nedim Sabic
'e-mail [email protected]
Private Sub SendToBin(sFileName As String)
Dim FileStruct As SHFILEOPSTRUCT
Dim x As Long
With FileStruct
.iFlags=ALLOWUNDO
.sForm=FileName
.lFunc=DELETE
End With
x=SHFileOperation(FileStruct)
End Sub
Private Sub Command1_Click()
SendToBin Text1.Text
End Sub
This code demostrate how to send any file to the Recycle Bin using one api call. Comments
No comments yet — be the first to post one!
Post a Comment