Does anyone have an ActiveX control that would monitor the progress of a file copy that is being done over the network? Any other suggestions about how to do that?
Printable View
Does anyone have an ActiveX control that would monitor the progress of a file copy that is being done over the network? Any other suggestions about how to do that?
You could use the SHFileOperation API function which shows the generic Windows file copy/move progress dialog.
Do you have a code example?
'this proc will copy files and shows an animated picture (it will create a folder if it does not exist)
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 Const FO_DELETE = &H3
Private Const FO_COPY = &H2
Private Const FO_MOVE = &H1
Private Const FO_RENAME = &H4
Private Const FOF_ALLOWUNDO = &H40
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Private Sub Command1_Click()
Dim SHFileOp As SHFILEOPSTRUCT
With SHFileOp
.pFrom = "c:\IouriApps\*.*"
.pTo = "c:\temp\download"
.wFunc = FO_COPY
End With
'perform file operation
SHFileOperation SHFileOp
MsgBox "The Folder '" + SHFileOp.pFrom + "' has been Copied To : " & SHFileOp.pTo, vbInformation + vbOKOnly, App.Title
End Sub
Iouri Boutchkine
[email protected]
Here is some code about the shfileOperation api.
(Do not forget to rate DSJ: he deserve!)
http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=
http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=
http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=
Have a nice day
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater