VBGood网站全文搜索 Google

搜索VBGood全站网页(全文搜索)
首页 - 经验之谈 - 移动文件到回收站
发表评论(0)作者:, 平台:, 阅读:11624, 日期:2000-03-12
移动文件到回收站

声明:

Public 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

End Type


Public Declare Function SHFileOperation Lib _

"shell32.dll" Alias "SHFileOperationA" (lpFileOp _

As SHFILEOPSTRUCT) As Long


Public Const FO_DELETE = &H3

Public Const FOF_ALLOWUNDO = &H40

代码:

Dim SHop As SHFILEOPSTRUCT

Dim strFile as string


With SHop

.wFunc = FO_DELETE

.pFrom = strFile + Chr(0)

.fFlags = FOF_ALLOWUNDO

End With


SHFileOperation SHop