[jawsscripts] Re: Scripting horror!

  • From: "Donald Marang" <donald.marang@xxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Mon, 5 Jan 2009 14:02:07 -0500

In my default level function I have tested both of these functions.  Both 
work and currently I check for the correct class and use GetOwningAppName. 
I have the older function commented out in case someone tried to use an 
older version of JAWS.  See the section of code at the end of this reply.  I 
almost made a mistake of complicating the code by checking both in the 
following manner using pseudo code:
If correct class && (new app function || old app function) Then

I figured the new function should be faster and JAWS would not bother 
evaluating any ffurther onvce the condition was true with the newer 
function.  I forgot that the older versions of JAWS would not be able to 
compile witghe newer functions present.  Is it good practice to take 
advantage of newer calls or retain the use of older calls for backwards 
compatability?

I did use BX, WinDig and the Home Row utilities to gather window 
information.  There were some quirks, but I think I have solved the problem 
of identifying and processing windows!  I wasted a lot of time at the 
beginning trying to reclassify windows.  This did not help in this 
application except for the list bbbbbview control.

I am still fighting to resolve the quirk in this application where it tends 
to lose focus and location of the PC cursor in certain instances.

Void Function CheckForToast (handle hWnd)
Var
 Handle hWndFirstChild,
 Int iFirstID

Let hWndFirstChild = GetFirstChild (hWnd)
Let iFirstID = GetControlID (hWndFirstChild)

If GetWindowClass (hWnd) == WND_VERIZON_CLASS
&& GetOwningAppName (hWnd) == VERIZON_APP_NAME Then ; only available in JAWS 
version 8 and higher -comment out and remove comment in next line if using 
an older version  (comment character = ";")
; && StringContains (GetWindowOwner (hWnd), VERIZON_APP_NAME) Then ; test 
this as well for older versions of JAWS before 8 (should not be quite as 
fast)
 ; SayString ("Custom dialog")
 If iFirstID == WCID_TOAST_CALL_CLOSE
 ||iFirstID == WCID_TOAST_VOICE_MAIL_CLOSE Then
  ; SayString ("Toast Window")
  ; VZCallAssistant::ToastEvent (hWnd)
  ; would eliminate the need for the ReformatPhoneNumber and ToastEvent 
functions from being in this file and being linked to default scripts with 
the Use statement
  ToastEvent (hWnd)
 EndIf
EndIf

EndFunction

Don Marang


----- Original Message ----- 
From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
To: <jawsscripts@xxxxxxxxxxxxx>
Sent: Monday, January 05, 2009 9:41 AM
Subject: [jawsscripts] Re: Scripting horror!


> Hi Don:
> I have seen this class used in many applications.  It is usually the
> main application window.
>
> Perhaps If you are testing for these windows in the Default scripts,
> you could use either  GetOwningAppName
> or GetWindowOwner first to see if the window belongs to your telephone
> application.
>
> Have you tried using bx to determine the correct path to use to get to
> some of the problem buttons?  Are these windows displayed long enough to
> reclasify or experiment on?
>
> David Farough
> Application Accessibility Coordinator/coordonateur de l'accessibilité
> Information Technology Services Directorate /
> Direction des services d'information technologiques
> Public Service Commission / Commission de la fonction publique
> Email / Courriel:  David.Farough@xxxxxxxxxxxxx
> Tel. / Tél:    (613) 992-2779
>
>>>> "Donald Marang" <donald.marang@xxxxxxxxx> 01:15 pm Thursday,
> January 01, 2009 >>>
> You described my situation with Verizon Call Assistant.  All of the
> dialogs
> have the class of "#32770".  I thought this was random until I
> discovered
> that Notepad also uses this class.  The application uses this class for
> the
> main window, the results window, the "Toast" windows that popup in the
>
> notification area like a HelpBalloon, windows that pop up like ToolTip
>
> windows and confirmation dialogs.  It would have been much simpler if I
>
> could just Reclassify individual windows as ToolTip and HelpBalloon!
> Instead I created my own WindowActivatedEvent, which checks for this
> class,
> then performs a series of If ... Then ... ElIf ... statements that
> check the
> Control ID and text of its first child to accurately determine the
> window.
>
>
> Although most of the Control IDs do not change, a few strangely have
> the
> same number.  Perhaps they lost count when creating the controls.  The
>
> numbers start at 201 and count up.  But the Close button in the title
> bar
> and the next page button use the same ID.
>
> All of this takes a lot of trial and error!
>
> I still have serious problems reliably moving to buttons that are
> visible on
> the screen with theMoveToControl statement!  Sometimes it seems that
> there
> is a barrier between the main dialog where the main buttons are located
> and
> other dialogs, like the results dialog.  I switch to the JAWS cursor,
> set
> the restriction to none, and try every way of moving the cursor and
> focus I
> know about.  But it fails!  Sometimes it performs and reads and reacts
> like
> I expect, but the PC cursor refuses to move to the new window when the
>
> function finishes.  In this function, I am not using any SaveCursor
> statements.
>
> The window handle of the application occasionally changes, even without
>
> closing!  I think its schizophrenic.  There are two instances of the
> application running all of the time according to WinDig.  Is this
> normal for
> an application that also runs in the system tray?    If I use nested
> statements throughout the application to dynamically get the main
> application window handle, the scripts fail.  I had to set a global
> variable
> and use that to make it work at all.  That is until the main
> application
> window handle decides to change.
>
> Slowly my scripts for this unruly application is becoming useful and
> more
> stable!  I had a lot of cases where it came in handy, like telling me
> my son
> called and left a message just after midnight while I was on the phone
> with
> my daughter.
>
> Don Marang
>
>
> __________
> Visit and contribute to The JAWS Script Repository http://jawsscripts.com
>
> View the list's information and change your settings at
> //www.freelists.org/list/jawsscripts
> 

__________ 
Visit and contribute to The JAWS Script Repository http://jawsscripts.com

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

Other related posts: