VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Move a file to the Recycling bin

by Anonymous (267 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Wed 16th December 1998
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Move a file to the Recycling bin

API Declarations


hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As Long
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

Rate Move a file to the Recycling bin




    With typOperation
        .wFunc = FO_DELETE
        .pFrom = "filename.txt"   'File to move to bin
        .fFlags = FOF_ALLOWUNDO
    End With
    SHFileOperation typOperation

Download this snippet    Add to My Saved Code

Move a file to the Recycling bin Comments

No comments have been posted about Move a file to the Recycling bin. Why not be the first to post a comment about Move a file to the Recycling bin.

Post your comment

Subject:
Message:
0/1000 characters