progress bar with copyfile??

Dec 1, 2011 at 2:23am
Hi. I am using CopyFile(source, dest, flag) and
I want to show current process on progressbar control.
As I found, I need to use Thread or call back function.
but i just want to use Timer func.

So, with my guess, On Timer function implements
Open dest file and get FileSize every single time(I set timer as 1 sec).
and calculate the progress bar position.

However, I think it is not efficient calling OpenFile every time until
timer is killed.

I don't know how to do it.

Any ideas?? help me!!
Dec 1, 2011 at 5:38am
Use CopyFileEx() and the callback function.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa363852(v=vs.85).aspx

Why do you reject this method?
Dec 1, 2011 at 6:05am
Use SHFileOperation() and you don't need any callback/progress function, it is all built-in (you get windows explorer progress dialog).
http://msdn.microsoft.com/en-us/library/windows/desktop/bb762164(v=vs.85).aspx.
Dec 2, 2011 at 2:07am
Thanks I got that!!
Topic archived. No new replies allowed.