OLEONTYEV
13 years agoOccasional Contributor
How to set up correct recognition of non-typical WPF controls.
Hello,
I'm testing a desktop WPF application using TC 8.70.
I have a problem with an incomplete tree of WPF controls in Object Browser (and in scripts, consequently).
The fact is, that I get 2 parallel trees using MSAA and WPF recognition. So, I get some properties and controls using a WPF tree, like that:
Sys.Process('My').WinFormsObject('MainForm').
WinFormsObject('MdiClient','').WinFormsObject('Workspace').WinFormsObject('_controlHostPanel').
WinFormsObject('Host').WinFormsObject('elementHost1').WPFObject('HwndSource: AdornerDecorator', 'elementHost1').
WPFObject('AdornerDecorator', '', 1).WPFObject('ContainerControl', '', 1).WPFObject('host').
WPFObject('WorkspaceView', '', 1).WPFObject('TabHostView', '', 2)
Other controls and properties are exposed using a common MSAA tree, the 1st part of which is the same. But at a certain point, the tree bifurcates, and I can not get it merged:
Sys.Process('My').WinFormsObject('MainForm').
WinFormsObject('MdiClient','').WinFormsObject('Workspace').WinFormsObject('_controlHostPanel').
WinFormsObject('Host').WinFormsObject('elementHost1').WPFObject('HwndSource: AdornerDecorator', 'elementHost1').
Client(0).Client(0).Client(2).TabList(0).PageTab('Configuration').Client(0).Button('Save')
It's one of the shortest side tree examples. And it leads to very bad practices in scripts, when we have to search for objects belonging to the same visual pane, but in different trees. Merging them would be fantastic. But I have added all the available class names to the OpenApplications/WPF page of the project properties, and I've got nothing.
Do I do anything wrong with the settings? Or is it a WPF feature?
I'm testing a desktop WPF application using TC 8.70.
I have a problem with an incomplete tree of WPF controls in Object Browser (and in scripts, consequently).
The fact is, that I get 2 parallel trees using MSAA and WPF recognition. So, I get some properties and controls using a WPF tree, like that:
Sys.Process('My').WinFormsObject('MainForm').
WinFormsObject('MdiClient','').WinFormsObject('Workspace').WinFormsObject('_controlHostPanel').
WinFormsObject('Host').WinFormsObject('elementHost1').WPFObject('HwndSource: AdornerDecorator', 'elementHost1').
WPFObject('AdornerDecorator', '', 1).WPFObject('ContainerControl', '', 1).WPFObject('host').
WPFObject('WorkspaceView', '', 1).WPFObject('TabHostView', '', 2)
Other controls and properties are exposed using a common MSAA tree, the 1st part of which is the same. But at a certain point, the tree bifurcates, and I can not get it merged:
Sys.Process('My').WinFormsObject('MainForm').
WinFormsObject('MdiClient','').WinFormsObject('Workspace').WinFormsObject('_controlHostPanel').
WinFormsObject('Host').WinFormsObject('elementHost1').WPFObject('HwndSource: AdornerDecorator', 'elementHost1').
Client(0).Client(0).Client(2).TabList(0).PageTab('Configuration').Client(0).Button('Save')
It's one of the shortest side tree examples. And it leads to very bad practices in scripts, when we have to search for objects belonging to the same visual pane, but in different trees. Merging them would be fantastic. But I have added all the available class names to the OpenApplications/WPF page of the project properties, and I've got nothing.
Do I do anything wrong with the settings? Or is it a WPF feature?