Hi: In Visual Studio 2013 Community Edition:

I used the Reclass hot key to check out the class of the error window
grabbing focus away from the text editor:

click error check in menu

Focus window: Original class:

RTaskList

Window Style:

44300000

Above is correct but below happens when i then change anything move and or
copy and paste:

change bad code arrow down focus goes to:

RTaskList

44300000

Focus Should have stayed in the text editor but is grabbed by what I think
is the error list.

Blasting through the code below if MSAA is still working properly it looks
like this sub should stop this inadvertent speeking of the error window but
it doesnt.

See any obvious ideas of why it may not be working in WE 9.1 but why it may
have worked in 8.4?

You can jump to the line:

"                ElseIf windowObj.ClassName = "RTaskList" Then"

to see the code that should handle this I think unless I am mising
something.

 

Sub OnChildFocus(windowObj)

    If Not windowObj Is Nothing Then

        If windowObj.IsValid Then

            On Error Resume Next

            ' This debug is left in on purpose

            'OutputDebugString  "@@@ IN " & windowObj.ModuleName & ":" &
windowObj.ClassName & ", " & windowObj.Name & ", " & windowObj.Title & "
@@@" & vbCrLf

            'OutputDebugString  "@@@ IN (Parent) " &
windowObj.Parent.ModuleName & ":" & windowObj.Parent.ClassName & ", " &
windowObj.Parent.Name & ", " & windowObj.Parent.Title & " @@@" & vbCrLf

            'OutputDebugString  "In supportedModules? " &
SO_InVBArray(supportedModules, windowObj.ModuleName) & vbCrLf

            On Error Goto 0

            If SO_InVBArray(supportedModules, windowObj.ModuleName) Then

' RtNote: the correct module name is in the array.

                If windowObj.Name = "PropertyGridView" Then

                    ' The Property window

                    Speak myStrings("PROPERTIES")

                    ' Ensure all previous hooking is disabled

                    UnHookEverything

 

                    ' We're going to handle all MSAA focus evens ourselves.
We'll do this by blocking focus events from Window-Eyes, and then

                    ' hooking the focus events with our own event handler

                    Set blockFocusEvent =
MSAAEventSource.BlockEvent(event_OBJECT_FOCUS,
ClientInformation.ApplicationProcess)

                    msaaEventObjectFocus = ConnectEvent(myMSAAEventSource,
"OnObjectFocus", "OnObjectFocus")

                Else

                    If TypeName(windowObj.Parent) <> "Empty" Then

                        Dim winParent : Set winParent = windowObj.Parent

                        If Not winParent Is  Nothing Then

                            If winParent.Name = "OverlayControl" Or
windowObj.Name = "DesignerFrame" Then

                                ' The form design window

                                Speak myStrings("DESIGN_WINDOW")

                                ' Ensure all previous hooking is disabled.

                                UnHookEverything

 

                                ' The form designer has a lot of event
information that we want to handle ourselves, so we'll block all the
relevant events from Window-Eyes

                                ' then hook them with our own event handler.

                                Set blockLocationChangeEvent =
MSAAEventSource.BlockEvent(event_OBJECT_LOCATIONCHANGE,
ClientInformation.ApplicationProcess)

                                Set blockValueChangeEvent =
MSAAEventSource.BlockEvent(event_OBJECT_VALUECHANGE,
ClientInformation.ApplicationProcess)

                                Set blockNameChangeEvent =
MSAAEventSource.BlockEvent(event_OBJECT_NAMECHANGE,
ClientInformation.ApplicationProcess)

                                Set blockSelectionEvent =
MSAAEventSource.BlockEvent(event_OBJECT_SELECTION,
ClientInformation.ApplicationProcess)

                                Set blockFocusEvent =
MSAAEventSource.BlockEvent(event_OBJECT_FOCUS,
ClientInformation.ApplicationProcess)

                                Set blockShowEvent =
MSAAEventSource.BlockEvent(event_OBJECT_SHOW,
ClientInformation.ApplicationProcess)

 

                                msaaEventObjectLocationChange =
ConnectEvent(myMSAAEventSource, "OnObjectLocationChange",
"OnObjectLocationChange")

                                msaaEventObjectValueChange =
ConnectEvent(myMSAAEventSource, "OnObjectValueChange",
"OnObjectValueChange")

                                msaaEventObjectNameChange =
ConnectEvent(myMSAAEventSource, "OnObjectNameChange", "OnObjectNameChange")

                                msaaEventObjectSelection =
ConnectEvent(myMSAAEventSource, "OnObjectSelection", "OnObjectSelection")

                                msaaEventObjectFocus =
ConnectEvent(myMSAAEventSource, "OnObjectFocus", "OnObjectFocus")

                                msaaEventObjectShow =
ConnectEvent(myMSAAEventSource, "OnObjectShow", "OnObjectShow")

                            End If

                        End If

                    End If

                End If

            ElseIf windowObj.ModuleName = "MSENV" Then

                If windowObj.ClassName = "VsTextEditPane" Then

                    ' The code window

                    Speak myStrings("CODE_WINDOW")

                    ' Ensure all previous hooking is disabled.

                    UnHookEverything

                ElseIf windowObj.ClassName = "RTaskList" Then

                    ' The Error/Warnings/Output window

                    ' Ensure all previous hooking is disabled.

                    UnHookEverything

 

                    ' Block focus and selection from Window-Eyes, and handle
those events ourselves.

                    Set blockFocusEvent =
MSAAEventSource.BlockEvent(event_OBJECT_FOCUS,
ClientInformation.ApplicationProcess)            

                    Set blockSelectionEvent =
MSAAEventSource.BlockEvent(event_OBJECT_SELECTION,
ClientInformation.ApplicationProcess)

 

                    msaaEventObjectFocus = ConnectEvent(myMSAAEventSource,
"OnObjectFocus", "OnObjectFocus")

                    msaaEventObjectSelection = ConnectEvent(MSAAEventSource,
"OnObjectSelection", "OnObjectSelection")

                ElseIf windowObj.ClassName = "ToolWindowSelect" Then

                    ' The Control-Tab window

                    Speak myStrings("TOOL_WINDOW")

                    ' Ensure all previous hooking is disabled.

                    UnHookEverything

 

                    ' Block focus and selection from Window-Eyes, and handle
those events ourselves.

                    Set blockFocusEvent =
MSAAEventSource.BlockEvent(event_OBJECT_FOCUS,
ClientInformation.ApplicationProcess)            

                    Set blockSelectionEvent =
MSAAEventSource.BlockEvent(event_OBJECT_SELECTION,
ClientInformation.ApplicationProcess)

 

                    msaaEventObjectFocus = ConnectEvent(myMSAAEventSource,
"OnObjectFocus", "OnObjectFocus")

                    msaaEventObjectSelection = ConnectEvent(MSAAEventSource,
"OnObjectSelection", "OnObjectSelection")

                ElseIf windowObj.ClassName = "TBToolboxPane" Then

                    ' The toolbox pane (Control-Alt-X)

                    ' Ensure all previous hooking is disabled.

                    UnHookEverything

 

                    ' Block focus from Window-Eyes, and handle those events
ourselves.

                    Set blockFocusEvent =
MSAAEventSource.BlockEvent(event_OBJECT_FOCUS,
ClientInformation.ApplicationProcess)            

                    msaaEventObjectFocus = ConnectEvent(myMSAAEventSource,
"OnObjectFocus", "OnObjectFocus")

                Else

                    ' Ensure all previous hooking is disabled.

                    UnHookEverything

                End If

            Else

                ' Ensure all previous hooking is disabled.

                UnHookEverything

            End If

        End If

    End If

End Sub

 

I dont want to start a heavy analysis of the problem but if you see anything
that jumps out at you or you have something I can check out to determine why
it is not working let me know.

Rick USA

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com/attachments/20150319/8aba175d/attachment.htm>
_______________________________________________
Any views or opinions presented in this email are solely those of the author 
and do not necessarily represent those of Ai Squared.

For membership options, visit 
http://lists.window-eyes.com/options.cgi/scripting-window-eyes.com/archive%40mail-archive.com.
For subscription options, visit 
http://lists.window-eyes.com/listinfo.cgi/scripting-window-eyes.com
List archives can be found at 
http://lists.window-eyes.com/private.cgi/scripting-window-eyes.com

Reply via email to