Click to See Complete Forum and Search --> : Monitor file copy progresss


comart
October 1st, 2001, 10:20 AM
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?

DSJ
October 1st, 2001, 11:05 AM
You could use the SHFileOperation API function which shows the generic Windows file copy/move progress dialog.

comart
October 1st, 2001, 12:34 PM
Do you have a code example?

Iouri
October 1st, 2001, 12:47 PM
'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
iouri@hotsheet.com

Cimperiali
October 2nd, 2001, 02:09 AM
Here is some code about the shfileOperation api.
(Do not forget to rate DSJ: he deserve!)

http://codeguru.com/cgi-bin/bbs/wt/showpost.pl?Board=vb&Number=61051&page=&view=&sb=

http://codeguru.com/cgi-bin/bbs/wt/showpost.pl?Board=vb&Number=61047&page=&view=&sb=

http://codeguru.com/cgi-bin/bbs/wt/showpost.pl?Board=vb&Number=61430&page=&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