# pywinauto.controls.uiawrapper
UI自動化元素的基本包裝
[TOC]
## *class* `pywinauto.controls.uiawrapper.LazyProperty`(*fget*)
Bases: `object`
對對象屬性的延遲計算。
屬性應表示不可變的數據,因為它將替換自身。由提供: [http://stackoverflow.com/a/6849299/1260742](http://stackoverflow.com/a/6849299/1260742)
## *class* `pywinauto.controls.uiawrapper.UIAWrapper`(*element\_info*)
Bases: [`pywinauto.base_wrapper.BaseWrapper`](pywinauto.base_wrapper.md)
用戶界面自動化(UIA)控件的默認包裝器。
所有其他UIA包裝都源于此。
此類包含許多基礎UIA功能的功能,以便與Windows一起使用。
大多數方法適用于每種元素類型。 例如,您可以在任何元素上click()。
### `automation_id`()
返回控件的自動化ID
### `can_select_multiple`()
SelectionProvider模式的CanSelectMultiple接口
指示UI自動化提供程序是否允許同時選擇多個子元素。
### `children_texts`()
獲取控件子級的文本
### `close`()
關閉窗口
只有支持Window模式的控件才能回答。 如果沒有(菜單陰影,工具提示......),請嘗試發送“Esc”鍵
### `collapse`()
顯示控件的所有子節點,控件或內容
ExpandCollapse控件模式的Collapse方法的接口。
### `expand`()
顯示控件的所有子節點,控件或內容
ExpandCollapse控件模式的Expand方法的接口。
### `friendly_class_name`()
返回控件的友好類名
在某些情況下,這與控制類不同。 class_name()是控件的實際“已注冊”窗口類,而friendly_class_name()希望是對用戶更有意義的東西。
例如,Checkbox實現為Buttons - 因此CheckBox的類是“Button” - 但友好的類是“CheckBox”
### `get_expand_state`()
指示控件的狀態:展開或折疊。
An interface to CurrentExpandCollapseState property of the ExpandCollapse control pattern. Values for enumeration as defined in uia\_defines module: expand\_state\_collapsed = 0 expand\_state\_expanded = 1 expand\_state\_partially = 2 expand\_state\_leaf\_node = 3
>
> `get_selection`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.get_selection "Permalink to this definition")
>
> An interface to GetSelection of the SelectionProvider pattern
>
> Retrieves a UI Automation provider for each child element that is selected. Builds a list of UIAElementInfo elements from all retrieved providers.
>
> `get_show_state`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.get_show_state "Permalink to this definition")
>
> Get the show state and Maximized/minimzed/restored state
>
> Returns values as following
>
> window\_visual\_state\_normal = 0 window\_visual\_state\_maximized = 1 window\_visual\_state\_minimized = 2
>
> `has_keyboard_focus`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.has_keyboard_focus "Permalink to this definition")
>
> Return True if the element is focused with keyboard
>
> `iface_expand_collapse` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_expand_collapse "Permalink to this definition")
>
> `iface_grid` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_grid "Permalink to this definition")
>
> `iface_grid_item` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_grid_item "Permalink to this definition")
>
> `iface_invoke` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_invoke "Permalink to this definition")
>
> `iface_item_container` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_item_container "Permalink to this definition")
>
> `iface_range_value` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_range_value "Permalink to this definition")
>
> `iface_scroll` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_scroll "Permalink to this definition")
>
> `iface_scroll_item` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_scroll_item "Permalink to this definition")
>
> `iface_selection` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_selection "Permalink to this definition")
>
> `iface_selection_item` *= None*
>
> `iface_table` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_table "Permalink to this definition")
>
> `iface_table_item` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_table_item "Permalink to this definition")
>
> `iface_text` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_text "Permalink to this definition")
>
> `iface_toggle` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_toggle "Permalink to this definition")
>
> `iface_transform` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_transform "Permalink to this definition")
>
> `iface_transformV2` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_transformV2 "Permalink to this definition")
>
> `iface_value` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_value "Permalink to this definition")
>
> `iface_virtualized_item` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_virtualized_item "Permalink to this definition")
>
> `iface_window` *= None*[?](#pywinauto.controls.uiawrapper.UIAWrapper.iface_window "Permalink to this definition")
>
> `invoke`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.invoke "Permalink to this definition")
>
> An interface to the Invoke method of the Invoke control pattern
>
> `is_active`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_active "Permalink to this definition")
>
> Whether the window is active or not
>
> `is_collapsed`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_collapsed "Permalink to this definition")
>
> Test if the control is collapsed
>
> `is_dialog`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_dialog "Permalink to this definition")
>
> Return true if the control is a dialog window (WindowPattern interface is available)
>
> `is_expanded`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_expanded "Permalink to this definition")
>
> Test if the control is expanded
>
> `is_keyboard_focusable`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_keyboard_focusable "Permalink to this definition")
>
> Return True if the element can be focused with keyboard
>
> `is_maximized`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_maximized "Permalink to this definition")
>
> Indicate whether the window is maximized or not
>
> `is_minimized`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_minimized "Permalink to this definition")
>
> Indicate whether the window is minimized or not
>
> `is_normal`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_normal "Permalink to this definition")
>
> Indicate whether the window is normal (i.e. not minimized and not maximized)
>
> `is_selected`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_selected "Permalink to this definition")
>
> Indicate that the item is selected or not.
>
> Only items supporting SelectionItem pattern should answer. Raise NoPatternInterfaceError if the pattern is not supported
>
> Usually applied for controls like: a radio button, a tree view item, a list item.
>
> `is_selection_required`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.is_selection_required "Permalink to this definition")
>
> An interface to IsSelectionRequired property of the SelectionProvider pattern.
>
> This property can be dynamic. For example, the initial state of a control might not have any items selected by default, meaning that IsSelectionRequired is FALSE. However, after an item is selected the control must always have at least one item selected.
>
> `legacy_properties`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.legacy_properties "Permalink to this definition")
>
> Get the element’s LegacyIAccessible control pattern interface properties
>
> `maximize`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.maximize "Permalink to this definition")
>
> Maximize the window
>
> Only controls supporting Window pattern should answer
>
> `menu_select`(*path*, *exact=False*)[?](#pywinauto.controls.uiawrapper.UIAWrapper.menu_select "Permalink to this definition")
>
> Select a menu item specified in the path
>
> The full path syntax is specified in: `pywinauto.menuwrapper.Menu.get_menu_path()`
>
> There are usually at least two menu bars: “System” and “Application” System menu bar is a standard window menu with items like: ‘Restore’, ‘Move’, ‘Size’, ‘Minimize’, e.t.c. This menu bar usually has a “Title Bar” control as a parent. Application menu bar is often what we look for. In most cases, its parent is the dialog itself so it should be found among the direct children of the dialog. Notice that we don’t use “Application” string as a title criteria because it couldn’t work on applications with a non-english localization. If there is no menu bar has been found we fall back to look up for Menu control. We try to find the control through all descendants of the dialog
>
> `minimize`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.minimize "Permalink to this definition")
>
> Minimize the window
>
> Only controls supporting Window pattern should answer
>
> `restore`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.restore "Permalink to this definition")
>
> Restore the window to normal size
>
> Only controls supporting Window pattern should answer
>
> `scroll`(*direction*, *amount*, *count=1*, *retry\_interval=0.1*)[?](#pywinauto.controls.uiawrapper.UIAWrapper.scroll "Permalink to this definition")
>
> Ask the control to scroll itself
>
> **direction** can be any of “up”, “down”, “left”, “right” **amount** can be only “line” or “page” **count** (optional) the number of times to scroll **retry\_interval** (optional) interval between scroll actions
>
> `select`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.select "Permalink to this definition")
>
> Select the item
>
> Only items supporting SelectionItem pattern should answer. Raise NoPatternInterfaceError if the pattern is not supported
>
> Usually applied for controls like: a radio button, a tree view item or a list item.
>
> `selected_item_index`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.selected_item_index "Permalink to this definition")
>
> Return the index of a selected item
>
> `set_focus`()[?](#pywinauto.controls.uiawrapper.UIAWrapper.set_focus "Permalink to this definition")
>
> Set the focus to this element
>
> `writable_props`[?](#pywinauto.controls.uiawrapper.UIAWrapper.writable_props "Permalink to this definition")
>
> Extend default properties list.
>
## *class* `pywinauto.controls.uiawrapper.UiaMeta(name, bases, attrs)`
>
> Bases: [`pywinauto.base_wrapper.BaseMeta`](pywinauto.base_wrapper.html#pywinauto.base_wrapper.BaseMeta "pywinauto.base_wrapper.BaseMeta")
>
> Metaclass for UiaWrapper objects
>
> *static* `find_wrapper`(*element*)[?](#pywinauto.controls.uiawrapper.UiaMeta.find_wrapper "Permalink to this definition")
>
> Find the correct wrapper for this UIA element
>
> `pywinauto.controls.uiawrapper.``lazy_property`[?](#pywinauto.controls.uiawrapper.lazy_property "Permalink to this definition")
>
> alias of [`LazyProperty`](#pywinauto.controls.uiawrapper.LazyProperty "pywinauto.controls.uiawrapper.LazyProperty")
- 什么是Pywinauto
- 入門指南
- 如何
- 等待長時間操作
- 遠程執行指南
- 每種不同控制類型可用的方法
- 貢獻者
- 開發筆記
- 待辦項目
- 更新日志
- 基本用戶輸入模塊
- pywinauto.mouse
- pywinauto.keyboard
- 主要用戶模塊
- pywinauto.application
- pywinauto.findbestmatch
- pywinauto.findwindows
- pywinauto.timings
- 特定功能
- pywinauto.clipboard
- pywinauto.win32_hooks
- 控件參考
- pywinauto.base_wrapper
- pywinauto.controls.hwndwrapper
- pywinauto.controls.menuwrapper
- pywinauto.controls.common_controls
- pywinauto.controls.win32_controls
- pywinauto.controls.uiawrapper
- pywinauto.controls.uia_controls
- Pre-supplied Tests
- pywinauto.tests.allcontrols
- pywinauto.tests.asianhotkey
- pywinauto.tests.comboboxdroppedheight
- pywinauto.tests.comparetoreffont
- pywinauto.tests.leadtrailspaces
- pywinauto.tests.miscvalues
- pywinauto.tests.missalignment
- pywinauto.tests.missingextrastring
- pywinauto.tests.overlapping
- pywinauto.tests.repeatedhotkey
- pywinauto.tests.translation
- pywinauto.tests.truncation
- 后端內部實施模塊
- pywinauto.backend
- pywinauto.element_info
- pywinauto.win32_element_info
- pywinauto.uia_element_info
- pywinauto.uia_defines
- 內部模塊
- pywinauto.controlproperties
- pywinauto.handleprops
- pywinauto.xml_helpers
- pywinauto.fuzzydict
- pywinauto.actionlogger
- pywinauto.sysinfo
- pywinauto.remote_memory_block