研发埠

标题: 如何利用API函数将文件放入回收站?  [打印本页]

作者: 孙宏雷    时间: 2013-7-2 13:52
标题: 如何利用API函数将文件放入回收站? 

作者: 淡写轻描    时间: 2013-7-2 13:56
**API函数声明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 LongPublic Const FO_DELETE = &H3 Public Const FOF_ALLOWUNDO = &H40 注释:调用Dim Shop As SHFILEOPSTRUCT, strFile as string With Shop .wFunc = FO_DELETE .pFrom = strFile + Chr(0) .fFlags = FOF_ALLOWUNDO End With




欢迎光临 研发埠 (http://bbs.yanfabu.com/) Powered by Discuz! X3.2