File Opération
| Description | Fonction de gestion des fichiers aves les animations du Shell Windows 95 et NT 4 |
| Utilise | |
| API | Incluses |
'************************************************
'API SHFileOperation
'************************************************
Public Const FO_MOVE As Long = &H1
Public Const FO_COPY As Long = &H2
Public Const FO_DELETE As Long = &H3
Public Const FO_RENAME As Long = &H4
Public Const FOF_MULTIDESTFILES As Long = &H1
Public Const FOF_CONFIRMMOUSE As Long = &H2
Public Const FOF_SILENT As Long = &H4
Public Const FOF_RENAMEONCOLLISION As Long = &H8
Public Const FOF_NOCONFIRMATION As Long = &H10
Public Const FOF_WANTMAPPINGHANDLE As Long = &H20
Public Const FOF_CREATEPROGRESSDLG As Long = &H0
Public Const FOF_ALLOWUNDO As Long = &H40
Public Const FOF_FILESONLY As Long = &H80
Public Const FOF_SIMPLEPROGRESS As Long = &H100
Public Const FOF_NOCONFIRMMKDIR As Long = &H200
Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Long
fAnyOperationsAborted As Long
hNameMappings As Long
lpszProgressTitle As String
End Type
Declare Function API_SHFileOperation Lib "Shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Public Function fwzFileOperation(Ordre As Long, OrgFile As String, DestFile As String) As Long
Dim result As Long
Dim fileop As SHFILEOPSTRUCT
With fileop
.hwnd = frmMain.hwnd
.wFunc = Ordre
' The files to copy separated by Nulls and terminated by 2 nulls
.pFrom = OrgFile & vbNullChar & vbNullChar
' The directory or filename(s) to copy into terminated in 2
' nulls
.pTo = DestFile & vbNullChar & vbNullChar
.fFlags = FOF_CREATEPROGRESSDLG Or FOF_FILESONLY Or FOF_NOCONFIRMATION
End With
result = API_SHFileOperation(fileop)
fwzFileOperation = result
End Function