[jawsscripts] Re: Progress bar in Explorer

  • From: <ptorpey00@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Sat, 26 Sep 2020 14:27:31 -0600

To calculate percent one takes the current value, divides by the maximum
value, and then multiplies by 100.

For example, if the maximum value is 10 and you are at a value of 2, you
divide the 2 by 10 to get point 2 and then multiply that point 2 by 100 to
get 20%, which of course, is 2 parts out of 10.

Hope that helps.

--Pete


-----Original Message-----
From: jawsscripts-bounce@xxxxxxxxxxxxx <jawsscripts-bounce@xxxxxxxxxxxxx> On
Behalf Of Udo Egner-Walter
Sent: Saturday, September 26, 2020 10:21 AM
To: jawsscripts@xxxxxxxxxxxxx
Subject: [jawsscripts] Progress bar in Explorer

Hello all,
I am currently creating some scripts for the Windows Explorer. I'm trying to
calculate the percentage of the progress bar that appears when you search
for files. 

Isn't it true that the current value has to be below the maximum value? In
my example I divided the maximum value by 100 to get one percent and then
calculate the current value (multiply the result of one percent and actual
value). 

But almost all the time the current value is above the maximum value. Do I
have an error in thinking here or is this a peculiarity of the Explorer? If
you search many files and look at the progress bar, you can often see that
the bar is almost full although many more files are being searched. 

Does anyone have an idea about this? I have added the code I used at the
end, in case someone wants to test it for himself. The announcement of the
values for minimum (SayInteger (iMin)), for maximum (SayInteger (iMax)) and
for the current value (SayInteger (iValue)) I commented out. 

Thanks a lot for suggestions and comments

Udo 

P. S. Here's the function with calling script: 

int function GetProgressValue ()
var
object oUIA,
object oElement,
object oCondition,
int iValue,
int iMax,
int iMin
oUIA = CreateObjectEx ("FreedomSci.UIA", 0, "UIAScriptAPI.x.manifest" )
oElement = oUIA.GetElementFromHandle(GetAppMainWindow(GetFocus()))
oCondition = oUIA.CreateStringPropertyCondition(UIA_ClassNamePropertyId,
"msctls_progress32") oElement = oElement.findFirst (treeScope_descendants,
oCondition) if oElement then iMin = oElement.GetRangeValuePattern().Minimum
iMax = oElement.GetRangeValuePattern().Maximum
iValue = oElement.GetRangeValuePattern().Value
iValue = (iMax / 100) * iValue
; SayInteger (iMin)
; SayInteger (iMax)
; SayInteger (iValue)
Return iValue
EndIf
EndFunction

Script SayValue ()
SayInteger (GetProgressValue ())
EndScript


__________�

View the list's information and change your settings at
//www.freelists.org/list/jawsscripts


__________�

View the list's information and change your settings at 
//www.freelists.org/list/jawsscripts

Other related posts: