The Descendants property returns all control of the selected type down the hierarchy:
$wnd = Start-Process calc -PassThru | Get-UiaWindow
$wnd.Descendants.Buttons
The oupput type is collection, so that to get a single control or several controls we need to feed the expression with numeric values:
$wnd.Descendants.Buttons[0]
$wnd.Descendants.Buttons[5..8]
or a fragment of their Name, AutomationId or ClassName properties
# only numeric button
# through their AutomationIds
$wnd.Descendants.Buttons['13*'] | Read-UiaControlName

Last edited Feb 10, 2014 at 12:52 PM by apetrovskiy, version 1

Comments

No comments yet.