Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleCopy a file with the Windows "copy file" animation
Keywordscopy file, animation
CategoriesFiles & Directories
 
Use the SHFileOperation API function.

Note that the operation is too quick to be interesting for short files. Copy a file of 1 MB or so into the program's directory and name the file TestFrom.txt to see the animation.

 
Public Sub SHCopyFile(ByVal from_file As String, ByVal _
    to_file As String)
Dim sh_op As SHFILEOPSTRUCT

    With sh_op
        .hWnd = 0
        .wFunc = FO_COPY
        .pFrom = from_file & vbNullChar & vbNullChar
        .pTo = to_file & vbNullChar & vbNullChar
        .fFlags = FOF_ALLOWUNDO
    End With

    SHFileOperation sh_op
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated