Chip,

After playing a bit more I believe I see the problem. I modified the script so the setSomethingElseAsFocus script would go through each child window and try to set focus to each and report whether it could or couldn't. I displayed the classname and failed or worked. In my Vista case there are 26 child windows with the Focusable attribute. So now the script is trying to set it to each of the 26 and reporting the status. Here are the ones that worked and here are the ones that didn't.

setting to ShellTabWindowClass - worked
setting to DUIViewWndClassName - worked
setting to TravelBand - worked
setting to Address Band Root - worked
setting to UniversalSearchBand - worked
setting to Search Control - worked
setting to ToolbarWindow32 - worked
setting to SHELLDLL_DefView  -worked
setting to CommonPlacesWrapperWndClass - worked
setting to NamespaceTreeControl  - worked

setting to WorkerW  - failed
setting to ReBarWindow32 - failed
setting to WorkerW - failed
setting to ReBarWindow32 - failed
setting to ToolbarWindow32 - failed
setting to msctls_progress32 - failed
setting to CtrlNotifySink - failed
setting to CtrlNotifySink - failed
setting to CtrlNotifySink - failed
setting to Breadcrumb Parent - failed
setting to ToolbarWindow32 - failed
setting to ToolbarWindow32 - failed
setting to Edit - failed
setting to ToolbarWindow32 - failed
setting to SysTreeView32 - failed
setting to SysHeader32 - failed

This is consistent for me. Meaning the ones that work always do and the ones that fail always fail. You are sort of randomly just picking the first control with the focusable attribute and in my case it was one that worked and in other's it wasn't. Unfortunately Microsoft is saying a control is focusable even though it really isn't. Welcome to the world of MSAA. Window-Eyes is constantly hacking around issues like this. So this really isn't a Window-Eye bug but more of a Microsoft MSAA issue with Windows Explorer.

Of course a script isn't going to try and set focus to some random control, you are going to set it to something you need, not because it has a focusable attribute so this most likely isn't a real world problem anyway.

But bottom line, I just don't see anything that says this is a WE problem.

Regards,
Doug

Chip Orange wrote:
thanks Doug.
you'll see Jeff is also having the problem under xp, while Jim, like you, is not under vista. I'll keep looking for the cause, but at the moment, I'm out of ideas, except to collect data from those who also experience the issue. Chip


------------------------------

Chip Orange
Database Administrator
Florida Public Service Commission

[email protected]
(850) 413-6314

(Any opinions expressed are solely those of the author and do not necessarily reflect those of the Florida Public Service Commission.)

    ------------------------------------------------------------------------
    *From:* Doug Geoffray [mailto:[email protected]]
    *Sent:* Tuesday, June 30, 2009 4:18 PM
    *To:* [email protected]
    *Subject:* Re: example for vista control not focusing problem

    Chip,

    I tried this exact script (unchanged) under Vista 32-bit SP 2 and
    had no problem.  When I activated a Windows Explorer window and
    the listview had focus I heard:

    setting the focus to something else
    custom control
    setting the focus to the listview control

    Visually I saw the listview control lose focus for a bit and then
    come back.  If I change the focus manually to say the treeview,
    alt-tab away from the Windows Explorer window and alt-tab back
    then I hear:

    setting the focus to the listview control

    and in fact the focus is on the listview control.

    So I'm just not seeing any problem...  You need to test this
    yourself on your Vista machine...

    Regards,
    Doug

    Chip Orange wrote:
    Hi Doug and Aaron,
I can't test this here where I wrote it, at least I can but it
    doesn't fail on xp, but below is an example of a script which
    waits for a windows explorer window to be made the active window,
    then when it is the script attempts to demonstrate the problem by
    setting some other control to be focused, then setting the list
    view to have the focus.
thanks. Chip --------- option explicit ' watch for newly activated windows (looking for Windows Explorer)
    connectEvent  desktopWindow, "onChildActivate", "onChildActivate"
sub onChildActivate ( window )
    if window is nothing then exit sub
    if not window.isValid then exit sub
    if strComp ( uCase ( window.moduleName), "BROWSEUI") <> 0 then
    exit sub
    if strComp ( uCase ( WINDOW.className),  "CABINETWCLASS") <> 0
    THEN EXIT SUB
    ' this is a windows explorer window, find the list view control
    ' do so with a slight delay to give the window time to populate,
    and to clear this handler routine as soon as possible
    queue "handleWindowsExplorerWindow", window
end sub sub HandleWindowsExplorerWindow ( window )
    ' search the children of this window, looking for the list of
    files, which we want to make the focused control when we return
    to this type of window
    dim oChild
    for each oChild in window.Children.filterByType(wtListView)
    if not window.isValid then exit sub
    if not oChild.isValid then exit sub
    If  oChild.Accessible.State.Focusable And oChild.Visible And
    oChild.Enabled  then
    ' this is the list of files in a windows explorer window
    If   oChild.Accessible.State.Focused  then
    setSomethingElseAsFocus ( window )
    If  not oChild.Accessible.State.Focused  then
    speak "setting the focus to the list view control" ' temporary
    oChild.focus
    sleep 1000
    If  not oChild.Accessible.State.Focused  then  speak "failed to
    set the list view as the focus!"
    end if
    exit sub
    end if
    next
    end sub
sub setSomethingElseAsFocus ( window )
    ' make some other control than the listview be the focus
    dim oChild
    for each oChild in window.Children
    if not window.isValid then exit sub
    if not oChild.isValid then exit sub
    if oChild.type <> wtListView then
    ' it's not a list view, so see if it can be focused
    If  oChild.Accessible.State.Focusable And oChild.Visible And
    oChild.Enabled  then
    ' this is focusable
    If  not oChild.Accessible.State.Focused  then
    speak "setting the focus to something else"
    oChild.focus
    sleep 1000
    If  not oChild.Accessible.State.Focused  then  speak "failed to
    set the alternate control as the focus!"
    end if
    exit sub
    end if
    end if '  oChild.type <> wtListView
    next
    end sub


    ------------------------------

    Chip Orange
    Database Administrator
    Florida Public Service Commission

    [email protected]
    (850) 413-6314

     (Any opinions expressed are solely those of the author and do
    not necessarily reflect those of the Florida Public Service
    Commission.)


-- Doug Geoffray
    GW Micro, Inc.
    Voice 260-489-3671
    Fax 260-489-2608
    http://www.gwmicro.com


--
Doug Geoffray
GW Micro, Inc.
Voice 260-489-3671
Fax 260-489-2608
http://www.gwmicro.com

Reply via email to