By Ken Huysmans on
2006-03-08T08:27:25
Some months ago I published an article explaining how to copy a file with a progressbar in VB.NET. I would like to thank you all for the great feedback on that article! Some days ago I received a mail with the question how to copy a whole directorystructure while showing the progress. So here's a possible solution. Please have a look at the original article first (http://www.khswsoft.be/Blog/tabid/81/EntryID/12/Default.aspx).
The necessary API functions:
Private Delegate Function CopyProgressRoutine(ByVal totalFileSize As Int64, ByVal totalBytesTransferred As Int64, ByVal streamSize As Int64, ByVal streamBytesTransferred As Int64, ByVal dwStreamNumber As Int32, ByVal dwCallbackReason As Int32, ByVal hSourceFile As Int32, ByVal hDestinationFile As Int32, ByVal lpData As Int32) As Int32
Private Declare Auto Function CopyFileEx Lib "kernel32.dll" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As CopyProgressRoutine, ByVal lpData As Int32, ByVal lpBool As Int32, ByVal dwCopyFlags As Int32) As Int32...
Read More »