Inspect.exe can find elements that UIAutomation cannot find

69 Views Asked by At

I have an application written in Qt/C++. It has a Window with child windows ( LocalizedControlType: ‘window’). Inspect can see these child windows, but my C# code using UIAutomation cannot.

Inspect can see these child windows even when in "UI Automation" Mode.

Does Inspect use UIAutomation?

This thread suggests that the controls may be available using UIAutomationCore.dll but I can't see how to use that from .Net

UIAutomation cannot find the child Window using:

elementWindow.FindAll(TreeScope.Descendants, Condition.TrueCondition);
TreeWalker.ContentViewWalker 
TreeWalker.ControlViewWalker
TreeWalker.RawViewWalker

But the child window and its child elements are available in Inspect:

How found:  Selected from tree...
Name:   "Flight Info"
ControlType:    UIA_WindowControlTypeId (0xC370)
LocalizedControlType:   "window"
BoundingRectangle:  {l:1591 t:227 r:1920 b:466}
IsEnabled:  true
IsOffscreen:    false
IsKeyboardFocusable:    false
HasKeyboardFocus:   false
AccessKey:  ""
ProcessId:  7632
ProviderDescription:    "[pid:7632,providerId:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]"
IsPassword: false
HelpText:   ""
IsDialog:   false
LegacyIAccessible.ChildId:  0
LegacyIAccessible.DefaultAction:    ""
LegacyIAccessible.Description:  ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: "Flight Info"
LegacyIAccessible.Role: window (0x9)
LegacyIAccessible.State:    normal (0x0)
LegacyIAccessible.Value:    ""
IsAnnotationPatternAvailable:   false
IsDragPatternAvailable: false
IsDockPatternAvailable: false
IsDropTargetPatternAvailable:   false
IsExpandCollapsePatternAvailable:   false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable:   false
IsItemContainerPatternAvailable:    false
IsLegacyIAccessiblePatternAvailable:    true
IsMultipleViewPatternAvailable: false
IsObjectModelPatternAvailable:  false
IsRangeValuePatternAvailable:   false
IsScrollItemPatternAvailable:   false
IsScrollPatternAvailable:   false
IsSelectionItemPatternAvailable:    false
IsSelectionPatternAvailable:    false
IsSpreadsheetItemPatternAvailable:  false
IsSpreadsheetPatternAvailable:  false
IsStylesPatternAvailable:   false
IsSynchronizedInputPatternAvailable:    false
IsTableItemPatternAvailable:    false
IsTablePatternAvailable:    false
IsTextChildPatternAvailable:    false
IsTextEditPatternAvailable: false
IsTextPatternAvailable: false
IsTextPattern2Available:    false
IsTogglePatternAvailable:   false
IsTransformPatternAvailable:    false
IsTransform2PatternAvailable:   false
IsValuePatternAvailable:    false
IsVirtualizedItemPatternAvailable:  false
IsWindowPatternAvailable:   false
IsCustomNavigationPatternAvailable: false
IsSelectionPattern2Available:   false
FirstChild: "" 
LastChild:  "Float" button
Next:   "Reports" window
Previous:   "" 
Other Props:    Object has no additional properties
Children:   "" 
    "Float" button
Ancestors:  "ACP RADAR" window
    "Desktop 1" pane
    [ No Parent ]
0

There are 0 best solutions below