|
-
Nov 11th, 1999, 10:01 PM
#1
Thread Starter
Lively Member
I'm fairly sure that there is a way to use windows explorer's file copy function (it might be called something different), but I don't know how. Can anyone help?
If not, does anyone know how I can copy a file from a network UNC to a local disk and show either a progress bar or similar while it's doing this?
Cheers
Chris
-
Nov 12th, 1999, 02:16 AM
#2
Try this:
Code:
Const FO_COPY = &H2
Private Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAborted As Boolean
hNameMaps As Long
sProgress As String
End Type
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Public Sub CopyFileProgress(pFileFrom As String, pFileTo As String, Optional pShowProgress As Boolean = True)
Dim structFO As SHFILEOPSTRUCT
Dim lRet As Long
With structFO
.wFunc = FO_COPY
.pFrom = pFileFrom & vbNullChar & vbNullChar
.pTo = pFileTo & vbNullChar & vbNullChar
.fFlags = 0
End With
lRet = SHFileOperation(structFO)
End Sub
Usage: CopyFileProgress FileFrom, FileTo
Sample: CopyFileProgress "\\ComputerName\D\MyFile.txt", "C:\MyFile.txt"
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-12-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|