[jawsscripts] Re: FindDecendentWindow script not working?

  • From: Brett <artibrett@xxxxxxxxx>
  • To: "jawsscripts@xxxxxxxxxxxxx" <jawsscripts@xxxxxxxxxxxxx>
  • Date: Fri, 10 Feb 2012 23:24:30 +1100

Hi Jacky, 

you were spot on, and it makes me feel better. This program is quite weerd, its 
written in several languages, so some controls have unique control ID's while 
others have a 0 ID. There are also 4 top level windows, so quite a doozy, but I 
am getting there slowly.

Thanks again for your great advice. 

Cheers, Brett.


Sent from Brett's iPhone

On 9 Feb 2012, at 11:30 PM, Jackie McBride <abletec@xxxxxxxxx> wrote:

> Bret, it might not be u, u know? It can take some trial-&-error (trial
> by fire?) & some liberal use of the homerow utility &/or Jamal's
> WinDig or Doug Lee's bx toolbox to ascertain the hierarchy.
> 
> The basic way I write these scripts looks like:
> var
> handle hw
> 
> let hw = FindDescendantWindow(GetAppMainWindow(GetCurrentWindow()), ControlID)
> if (hw) then ;tests to see if a window has indeed been found
> SetFocus(hw) ;or moveTo(hw)+a mouse click
> endif
> 
> That is a basic skeleton. Sometimes the window is not in fact
> necesarily a descendant of the current window--thus the suggestion
> about the use of the builtin homerow utility or Jamal's WinDig or
> Doug's bx toolbox.
> 
> The MoveToControl() takes 2 parameters, the window handle & the
> control ID. Since the handle will change w/every opening & closing of
> the program, you've gotta use GetAppMainWindow() or
> GetCurrentWindow()--somethin like that. The 2nd parameter is the
> controlID. Again, since these moveTo ... functions return an integer
> (really, it's a boolean, but...) it's best to test for success, e.g.,
> if (MoveToControl(hw, ID)) then ... endif
> 
> Hopefully that helps?
> 
> On 2/9/12, Brett <artibrett@xxxxxxxxx> wrote:
>> Its been ages since I have had to script something and now I need to do
>> this for an application at work, but I seem to have forgotten most of
>> what I had learnt ages ago.
>> 
>> Can someone please give me a basic example of moving to a specific
>> control using either FindDecendantWindow or MoveToControl. I cannot get
>> either of these to work, so I must be doing something wrong. At least
>> this program does seem to have unique control id's.
>> 
>> Huge thanks in advance to anyone who can help.
>> 
>> 
>> Cheers,
>> Brett.
>> 
>> __________�
>> 
>> View the list's information and change your settings at
>> //www.freelists.org/list/jawsscripts
>> 
>> 
> 
> 
> -- 
> Blame the computer--why not? It can't defend itself & occasionally
> might even be the culprit
> Jackie McBride
> Ask Me Computer Questions at: www.pcinquirer.com
> Jaws Scripting training materials: www.screenreaderscripting.com
> homePage: www.abletec.serverheaven.net
> __________�
> 
> 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: