Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleCopy a file with the Windows "copy file" animation
Keywordscopy file, animation
CategoriesFiles and 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-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated