Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: ShFileOperation



Permlink Replies: 2 - Last Post: Aug 10, 2017 2:25 AM Last Post By: Roy Lambert Threads: [ Previous | Next ]
Roy Lambert

Posts: 1,063
Registered: 8/7/01
ShFileOperation
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 9, 2017 8:17 AM
Using D2006

Is there a way of setting where the progress dialog is shown when using ShFileOperation to copy large files?

I have a progress bar in my application and copy several files at a time (one by one). The progress bar shows the overall progress with the ShFileOperation progress display showing when they're large. I'd like to position the ShFileOperation progress display just below my progress bar.

Roy Lambert

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: ShFileOperation
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 9, 2017 9:57 AM   in response to: Roy Lambert in response to: Roy Lambert
Roy Lambert wrote:

Is there a way of setting where the progress dialog is shown when
using ShFileOperation to copy large files?

In a word, no.

I have a progress bar in my application and copy several files at a
time (one by one). The progress bar shows the overall progress with
the ShFileOperation progress display showing when they're large. I'd
like to position the ShFileOperation progress display just below my
progress bar.

If you use CopyFileEx() instead, you can provide it with a status
callback function so you can display status in your own progress UI:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa363852.aspx

Or, on Vista+, you can use IFileOperation (like the SHFileOperation()
documentation says to), providing it with an IOperationsProgressDialog
interface via the IFileOperation.SetProgressDialog() method so you can
receive status callbacks:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb775803.aspx

For instance, I would add a TLabel and second TProgressBar to your
existing UI, where the TLabel displays the current filename being
copied, and the TProgressBar displays the percent complete of that file.

--
Remy Lebeau (TeamB)
Roy Lambert

Posts: 1,063
Registered: 8/7/01
Re: ShFileOperation
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 10, 2017 2:25 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy

Is there a way of setting where the progress dialog is shown when
using ShFileOperation to copy large files?

In a word, no.

That's the conclusion I'd reached after much googling. I did find one hint about creating a "micro" form and using its handle in the call. I may have a look at that.

Thanks for the other ideas - I'll have a play around.

Roy
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02