[jawsscripts] Re: Focus To Control ID

  • From: "David Farough" <David.Farough@xxxxxxxxxxxxx>
  • To: <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 09 Jul 2010 11:15:01 -0400

That was a good function Jackie.
But if you specify when creating the function that it returns a handle,
then you could have included a 
Return hw at the end of the function.  This way you could test the
results of the function call when you use it.

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 

>>> Jackie McBride <abletec@xxxxxxxxx> 09:26 AM Friday, July 09, 2010
>>>
Let's try this, Mike.

var
   handle hw

let hw = FindDescendantWindow(GetAppMainWindow(GetCurrentWindow()),
ControlID)
if (hw) then
   SetFocus(hw)
else
  sayMessage(OT_NO_DISABLE, "window not found")
endif

U may have to do some experimenting regarding finding the particular
window. Also, make certain the program actually does allow this window
to in fact be focused, else the function won't work, &, because it
returns void, the only way you'll know that is to not have it do what
it's supposed to do. Fine for u, not so fine if it's a user for whom
you're scripting lol.

U can also use the FindWindowWithClassAndID() function, which takes
both a window class & a control ID. Experiment w/those & see if either
works for u.

HTH.

HTH.

On 7/9/10, Steve Matzura <number6@xxxxxxxxxxxxx> wrote:
> Since you can only set focus to a window by its handle, the only
thing
> I can think of to re-create your function is to write a tree-walker,
> which does what HRM does, but in an automated fashion--namely, the
> F2/Shift+F2 functionality and the TAB/Shift+TAB functionality to
> inspect each and every window of the application to find its control
> ID and match it against the one you want.  When you find it, save
its
> handle in a handle variable, then you can do whatever you need to
> because you know how to get there and set focus to it or do
whatever.
> Funny thing about this is, I took two weeks of scripting class at FS
> two years ago, and this is the one thing I never got to figure out
how
> to do.
>
> On Fri, 9 Jul 2010 06:36:25 +0100, you wrote:
>
>>Hi All,
>>
>>I used to have a function that would set the focus to a specified
control
>> ID
>>but somehow it has disappeared. Does anyone have a suggestion for
this?
>>
>>Regards,
>>
>>Mike
>>
>>__________
> __________
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts 
>
>


-- 
Change the world--1 deed at a time
Jackie McBride
Scripting Classes: http://jawsscripting.lonsdalemedia.org 
homePage: www.abletec.serverheaven.net 
For technophobes: www.technophoeb.com 
__________

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


This e-mail message is intended for the named recipient(s) and 
may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. Unauthorized 
disclosure, copying or re-transmission is prohibited. If you are not 
a named recipient or not authorized by the named recipient(s), or 
if you have received this e-mail in error, then please notify the 
sender immediately and delete the message and any copies.
 
Ce courriel est destine exclusivement au destinataire mentionne 
en titre et peut contenir de l'information privilegiee, confidentielle 
ou soustraite a la communication aux termes des lois 
applicables. Toute divulgation non autorisee, toute reproduction 
ou reacheminement est interdit. Si vous n'etes pas le 
destinataire de ce courriel, ou n'etes pas autorise par le 
destinataire vise, ou encore, si vous l'avez recu par erreur, 
veuillez le mentionner immediatement a l'expediteur et supprimer 
le courriel et les copies. 
__________�

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

Other related posts: