UIAutomation
Soucasti WPF je novy UI-automation framework nahrazujici starsi Active Accessibility. Vice se dozvite na MSDN:
http://msdn2.microsoft.com/en-us/library/ms747327.aspx
|
130# $null = import-assembly 'UIAutomationClient'
131#
131# function Process-Element($el, $indent=0) {
>>
>> "$(New-Object String ' ', (2 * $indent))$($el.Current.LocalizedControlType): $($el.Current.Name)"
>>
>> $children = $el.FindAll('Children', [Windows.Automation.Condition]::TrueCondition)
>>
>> foreach($c in $children) {
>> Process-Element $c ($indent + 1)
>> }
>> }
>>
132# $wordpad = Get-Process wordpad -ea SilentlyContinue | Select -First 1
133#
133# if (-not $wordpad) {
>> & "$Env:ProgramFiles\Windows NT\Accessories\wordpad.exe"
>> sleep -milli 600
>>
>> $wordpad = Get-Process wordpad
>> }
>>
134# $windowHandle = $wordpad.MainWindowHandle
135# $window = [Windows.Automation.AutomationElement]::FromHandle( $windowHandle )
136#
136# Process-Element $window
window: Document - WordPad
pane: For Help, press F1
pane: Standard
pane: Formatting
pane: Arial
pane: Arial
pane: 10
pane: 10
pane: Central European
pane: Central European
pane: Standard
pane:
pane:
137# |