I lang tid har samarbejdsbranchen fokuseret på at forbedre enhedsfunktioner – bedre kameraer, klarere lyd og smartere software. Men den virkelige forvandling handler ikke om funktioner.
\'-------------------------------- Module1 -------------------------------- Public Declare Function SHFileOperation Lib _ \"shell32.dll\" Alias \"SHFileOperationA\" _ (lpFileOp As Any) As Long
Public Declare Sub SHFreeNameMappings Lib _ \"shell32.dll\" (ByVal hNameMappings As Long)
Public Declare Sub CopyMemory Lib \"KERNEL32\" _ Alias \"RtlMoveMemory\" (hpvDest As Any, hpvSource _ As Any, ByVal cbCopy As Long)
Public Type SHFILEOPSTRUCT hwnd As Long wFunc As FO_Functions pFrom As String pTo As String fFlags As FOF_Flags fAnyOperationsAborted As Long hNameMappings As Long lpszProgressTitle As String End Type
Public Enum FO_Functions FO_MOVE = &H1 FO_COPY = &H2 FO_DELETE = &H3 FO_RENAME = &H4 End Enum
.fFlags = FOF_SIMPLEPROGRESS Or FOF_RENAMEONCOLLISION End With
lret = SHFileOP(fileop)
If result <> 0 Then MsgBox Err.LastDllError Else If fileop.fAnyOperationsAborted <> 0 Then MsgBox \"Operation Failed\" End If End If End Function
Public Function sDelete(sFile) \'Slette filer eller mapper Dim lret As Long Dim fileop As SHFILEOPSTRUCT
With fileop .hwnd = 0 .wFunc = FO_DELETE .pFrom = sFile .lpszProgressTitle = sFile1 .fFlags = FOF_SIMPLEPROGRESS Or FOF_ALLOWUNDO End With
lret = SHFileOP(fileop)
If result <> 0 Then MsgBox Err.LastDllError Else If fileop.fAnyOperationsAborted <> 0 Then MsgBox \"Operation Failed\" End If End If End Function
Public Function sRename(sFile1, sFile2) \'Omdøbe filer eller mapper Dim lret As Long Dim fileop As SHFILEOPSTRUCT
With fileop .hwnd = 0 .wFunc = FO_RENAME .pFrom = sFile1 .pTo = sFile2 .lpszProgressTitle = \"Fra: \" & sFile1 & \" Til: \" & sFile2 .fFlags = FOF_SIMPLEPROGRESS Or FOF_ALLOWUNDO End With
lret = SHFileOP(fileop)
If result <> 0 Then MsgBox Err.LastDllError Else If fileop.fAnyOperationsAborted <> 0 Then MsgBox \"Operation Failed\" End If End If End Function
Public Function sMove(sFile1, sFile2) \'Flytte filer eller mapper Dim lret As Long Dim fileop As SHFILEOPSTRUCT
With fileop .hwnd = 0 .wFunc = FO_MOVE .pFrom = sFile1 .pTo = sFile2 .lpszProgressTitle = \"Fra: \" & sFile1 & \" Til: \" & sFile2 .fFlags = FOF_SIMPLEPROGRESS Or FOF_ALLOWUNDO End With
lret = SHFileOP(fileop)
If result <> 0 Then MsgBox Err.LastDllError Else If fileop.fAnyOperationsAborted <> 0 Then MsgBox \"Operation Failed\" End If End If End Function \'-------------------------------- Module1 --------------------------------
Private Sub Command1_Click() \'sMove \"C:\\Temp\\TestFile.txt\", \"C:\\\" sMove \"C:\\TestMappe\", \"C:\\Temp\" End Sub
Private Sub Command3_Click() \'sCopy \"D:\\TestFile.txt\", \"C:\\\" sCopy \"C:\\TestMappe\", \"C:\\Temp\" End Sub
Private Sub Command4_Click() \'sDelete \"C:\\TestFile.txt\" sDelete \"C:\\TestMappe\" End Sub
Private Sub Command5_Click() \'sRename \"C:\\Ejay_se.zip\", \"C:\\Ejay_se.zip_\" sRename \"C:\\TestMappe\", \"C:\\TestMappe2\" End Sub
\'-------------------------- hvis du skal kopier flere filer -------------------------- \'sCopy \"D:\\ser.htm\" & vbNullChar & \"D:\\test.htm\", \"C:\\\" \'-------------------------- hvis du skal kopier flere filer --------------------------
nu i snakker om progress bars, jeg kan ikke finde mit ikon for progress baren, sltså jeg ANER ikke hvordan jeg \"adder\" en progress bar til min form.
Ved i hvor jeg kan finde den/enable den??
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.