progress bar

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

progress bar

Post by PepsiHog » Thu Jul 12, 2018 7:16 pm

Hello Everyone,

I want to create my own progress bar. The only thing is I don't know the math or how to go about it.

What I want to know is if the formula that Microsoft uses for coping, moving and such is known and if someone knows how to use it in Macro Scheduler.

I want to create my own routine for copying, I want to create my own window. The only thing I am missing is the progress bar calculations.

Of course, it does not have to be the Microsoft formula. It could be something accurate, instead. But either will work.

Any idea or thoughts?

Thanks.

BTW - Though it says Windows 10 below, right now I am using Windows 7. I don't believe that should matter, but just in case it does.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: progress bar

Post by Grovkillen » Fri Jul 13, 2018 11:46 am

What do you mean, the visual look of the progress bar or how it progress?
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
PepsiHog
Automation Wizard
Posts: 511
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Re: progress bar

Post by PepsiHog » Fri Jul 13, 2018 2:09 pm

The math.

I have the progress bar in the dialog. All I need is the calculation (as close to accurate as possible). I need to be able to calculate how long it will take for a copy, and apply that to how fast the green bar moves across the progress bar.

Thanks.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2021) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Grovkillen
Automation Wizard
Posts: 1009
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: progress bar

Post by Grovkillen » Fri Jul 13, 2018 2:26 pm

I only do it as this:
%CURRENT_FILE_NO%/%TOTAL_NO_FILES%*100

Don't try to get the time, not even Microsoft get it right. Display the currently transferred file name and the user get the feeling of how long it'll take.
Let>ME=%Script%

Running: 15.0.24
version history

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: progress bar

Post by Marcus Tettmar » Tue Jul 17, 2018 7:36 am

As Grovkillen, says, there's no way to know the time. Microsoft can probably do it because they are controlling the transfer of each individual byte, and then they can either report percentage of bytes copied or perhaps as it goes they can average time and therefore predict. But we're working at a higher level and we have no way of knowing how long it will take, nor do we have any feedback DURING the copying of the file, so how can we report progress. We can't. Best to let the OS do it by setting CF_ANIMATE to 1.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts