CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2000
    Posts
    265

    Monitor file copy progresss

    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?


  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868

    Re: Monitor file copy progresss

    You could use the SHFileOperation API function which shows the generic Windows file copy/move progress dialog.


  3. #3
    Join Date
    Aug 2000
    Posts
    265

    Re: Monitor file copy progresss

    Do you have a code example?


  4. #4
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: Monitor file copy progresss

    '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]
    Iouri Boutchkine
    [email protected]

  5. #5
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Monitor file copy progresss

    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
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured