Hi everyone, please can anyone show me how to show a progress bar while copying a file. I tried using SetTimer() but i does not work the way i want it i.e the file gets copied after the given time has finished.

Recommended Answers

All 2 Replies

I am not sure about your code but you should put following code in constructor or init method,

m_progress.SetRange(0,100); 
m_progress.SetPos(0);

and StepIt() in a timer procedure,

m_progress.StepIt()

What functions are you using to do the copying? win32 api CopyFileEx() will call your function for each portion of the file that has been copied, allowing it to update the progress bar.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.