Sometimes we need to get exactly the first or the last child. There are Get-UIAControlFirstChild and Get-UIAControlLastChild cmdlets on service:
Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name 1 | Get-UIAControlParent | Get-UIAControlFirstChild | Read-UIAControlName;
Start-Process calc -PassThru | Get-UIAWindow | Get-UIAButton -Name 1 | Get-UIAControlParent | Get-UIAControlLastChild | Read-UIAControlName;

Tags: TreeWalker.GetFirstChild, TreeWalker.GetLastChild

Last edited Jan 22, 2013 at 5:03 AM by xinliu, version 2

Comments

No comments yet.