[jawsscripts] Re: Progress bar in Explorer

  • From: Udo Egner-Walter <udo.egner-walter@xxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Sun, 27 Sep 2020 11:44:01 +0200

Hello everybody, 

@Arthur & Pete
Thank you for your hints concerning the calculation. You can see that my school 
days are long ago 😀 

@Csaba, 
Thank you very much as well. I thought something like that and I will follow 
your advice and point out in the script that the search process is not finished 
yet. 

Best regards
Udo 

Am 26.09.2020 um 20:09 schrieb Csaba Árpádházy-Godo 
<arpadhazi68.jawsul@xxxxxxxxx>:

Hi Udo,

The progressbar, you see when you search many files, is a tricky 
control. As far as I remember, it is initialized at every change of 
folders during the search process. I propose you not to deal with 
calculating percentages, but simply say "Search in progress" message to 
your user. The intervall of saying this message you can read from the 
default.jcf. The "ProgressBarUpdateInterval" entry holds its value. With 
a ScheduleFunction () function you can manage it simply.
HTH

Chaba

2020. 09. 26. 18:21 keltezéssel, Udo Egner-Walter írta:
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


__________�

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

Other related posts: