Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This code moves a file to the recycle been....
Author:
Zack Nealson
E-mail:
Click to e-mail author
Submitted:
12/12/2000
Version:
VB5
Compatibility:
VB5, VB6
Category:
File Manipulation
Views:
8945
This code moves a file to the recycle been.
Declarations:
Declare Function SHFileOperation Lib "shell32.dll" Alias " SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long 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 String End Type
Code:
Public Function Recycle(strFilename As String) As Boolean Dim FileOperation As SHFILEOPSTRUCT Const FO_DELETE = &H3 Const FOF_ALLOWUNDO = &H40 FileOperation.wFunc = FO_DELETE FileOperation.pFrom = strFilename ' the file to delete FileOperation.fFlags = FOF_ALLOWUNDO ' set flag to UNDO delete option Recycle = SHFileOperation(FileOperation) = 0 End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2023 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement