How do I copy a file and display progress?
-
Anyone know how to initiate a file copy and display the progress of said copy? I can't figure out how to use the CopyFileEx API and it's callback. That's the only way I've seen to do this. --Tony Archer "I can build it good, fast and cheap. Pick any two."
-
Anyone know how to initiate a file copy and display the progress of said copy? I can't figure out how to use the CopyFileEx API and it's callback. That's the only way I've seen to do this. --Tony Archer "I can build it good, fast and cheap. Pick any two."
you can open the file manually get the size and copy it in set sized buffers to another file you created, using a progress bar to show the progress.
-
Anyone know how to initiate a file copy and display the progress of said copy? I can't figure out how to use the CopyFileEx API and it's callback. That's the only way I've seen to do this. --Tony Archer "I can build it good, fast and cheap. Pick any two."
It is the only way, unless you want to write your own file copy class with a dialog that shows progress. Post the code that your using, including the DllImport, to call the function so we can figure out what your doing wrong. You don't need to supply a callback to the function. If you don't supply one (pass in
null
in that parameter), theCopyFileEx
function will display it's own progress dialog. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome -
It is the only way, unless you want to write your own file copy class with a dialog that shows progress. Post the code that your using, including the DllImport, to call the function so we can figure out what your doing wrong. You don't need to supply a callback to the function. If you don't supply one (pass in
null
in that parameter), theCopyFileEx
function will display it's own progress dialog. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming GnomeHi, thats exactly what i figured out i few days before. I developed a filebrowser. And it also contains a dialog for copying files and it shows the progress. Look to class copydialog of the file clipboard.cs.
Download from www.slenders.be
It also contains examples for moving files, copying folders, etc.
Just take a look
Jonathan Slenders