代码如下: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 String ' only used if FOF_SIMPLEPROGRESS
End Type
Private Declare Function SHFileOperation Lib "Shell32.dll" _
Alias "SHFileOperationA" _
(lpFileOp As Any) As Long
Dim result As Long
With fileop
.wFunc = FO_DELETE
.pFrom = File1.FileName
.fFlags = FOF_ALLOWUNDO Or FOF_NOCONFIRMATION Or _
FOF_NOCONFIRMMKDIR
End With
result = SHFileOperation(fileop)
If result <> 0 Then
MsgBox Err.LastDllError
Else
If fileop.fAnyOperationsAborted <> 0 Then
MsgBox "Operation Failed"
Else
MsgBox "文件成功移入回收站!", vbInformation + vbOKOnly, App.Title
End If
End If
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
运行时总会显示SHFileOperation子程序或函数未定义。请问这是怎么回事?