返回
 
uiautomation
index
e:\codes\python\python-uiautomation-for-windows\uiautomation\uiautomation.py

uiautomation for Python 3.
Author: yinkaisheng@foxmail.com
Source: https://github.com/yinkaisheng/Python-UIAutomation-for-Windows
 
This module is for UIAutomation on Windows(Windows XP with SP3, Windows Vista and Windows 7/8/8.1/10).
It supports UIAutomation for the applications which implmented IUIAutomation, such as MFC, Windows Form, WPF, Modern UI(Metro UI), Qt, Firefox and Chrome.
Run 'automation.py -h' for help.
 
uiautomation is shared under the Apache Licene 2.0.
This means that the code can be freely copied and distributed, and costs nothing to use.

 
Modules
       
atexit
comtypes
ctypes
datetime
os
re
struct
sys
threading
time

 
Classes
       
_ctypes.Structure(_ctypes._CData)
ConsoleScreenBufferInfo
HARDWAREINPUT
INPUT
KEYBDINPUT
MOUSEINPUT
tagPROCESSENTRY32
builtins.object
AccessibleRole
AccessibleSelection
AccessibleState
AnnotationPattern
AnnotationType
Bitmap
ClipboardFormat
ConsoleColor
Control
AppBarControl
ButtonControl
CalendarControl
CheckBoxControl
ComboBoxControl
CustomControl
DataGridControl
DataItemControl
DocumentControl
EditControl
GroupControl
HeaderControl
HeaderItemControl
HyperlinkControl
ImageControl
ListControl
ListItemControl
MenuBarControl
MenuControl
MenuItemControl
PaneControl(Control, TopLevel)
ProgressBarControl
RadioButtonControl
ScrollBarControl
SemanticZoomControl
SeparatorControl
SliderControl
SpinnerControl
SplitButtonControl
StatusBarControl
TabControl
TabItemControl
TableControl
TextControl
ThumbControl
TitleBarControl
ToolBarControl
ToolTipControl
TreeControl
TreeItemControl
WindowControl(Control, TopLevel)
ControlType
CustomNavigationPattern
DockPattern
DockPosition
DpiAwarenessContext
DragPattern
DropTargetPattern
ExpandCollapsePattern
ExpandCollapseState
GAFlag
GWL
GridItemPattern
GridPattern
InputType
InvokePattern
ItemContainerPattern
KeyboardEventFlag
Keys
LegacyIAccessiblePattern
Logger
MB
ModifierKey
MouseEventFlag
MultipleViewPattern
NavigateDirection
ObjectModelPattern
OrientationType
PatternId
ProcessDpiAwareness
ProcessInfo
PropertyId
RangeValuePattern
Rect
RotateFlipType
RowOrColumnMajor
SW
SWP
ScrollAmount
ScrollItemPattern
ScrollPattern
SelectionItemPattern
SelectionPattern
SpreadsheetItemPattern
SpreadsheetPattern
StyleId
StylesPattern
SynchronizedInputPattern
TableItemPattern
TablePattern
TextAttributeId
TextChildPattern
TextEditPattern
TextPattern
TextPattern2
TextPatternRangeEndpoint
TextRange
TextUnit
TogglePattern
ToggleState
TopLevel
TransformPattern
TransformPattern2
UIAutomationInitializerInThread
ValuePattern
VirtualizedItemPattern
WindowInteractionState
WindowPattern
WindowVisualState
ZoomUnit

 
class AccessibleRole(builtins.object)
    AccessibleRole from IUIAutomation.
Refer https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.accessiblerole?view=netframework-4.8
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Alert = 8
Animation = 54
Application = 14
Border = 19
ButtonDropDown = 56
ButtonDropDownGrid = 58
ButtonMenu = 57
Caret = 7
Cell = 29
Character = 32
Chart = 17
CheckButton = 44
Client = 10
Clock = 61
Column = 27
ColumnHeader = 25
ComboBox = 46
Cursor = 6
Diagram = 53
Dial = 49
Dialog = 18
Document = 15
DropList = 47
Equation = 55
Graphic = 40
Grip = 4
Grouping = 20
HelpBalloon = 31
HotkeyField = 50
Indicator = 39
IpAddress = 63
Link = 30
List = 33
ListItem = 34
MenuBar = 2
MenuItem = 12
MenuPopup = 11
Outline = 35
OutlineButton = 64
OutlineItem = 36
PageTab = 37
PageTabList = 60
Pane = 16
ProgressBar = 48
PropertyPage = 38
PushButton = 43
RadioButton = 45
Row = 28
RowHeader = 26
ScrollBar = 3
Separator = 21
Slider = 51
Sound = 5
SpinButton = 52
SplitButton = 62
StaticText = 41
StatusBar = 23
Table = 24
Text = 42
TitleBar = 1
ToolTip = 13
Toolbar = 22
WhiteSpace = 59
Window = 9

 
class AccessibleSelection(builtins.object)
    AccessibleSelection from IUIAutomation.
Refer https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.accessibleselection?view=netframework-4.8
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AddSelection = 8
ExtendSelection = 4
None_ = 0
RemoveSelection = 16
TakeFocus = 1
TakeSelection = 2

 
class AccessibleState(builtins.object)
    AccessibleState from IUIAutomation.
Refer https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.accessiblestates?view=netframework-4.8
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AlertHigh = 268435456
AlertLow = 67108864
AlertMedium = 134217728
Animated = 16384
Busy = 2048
Checked = 16
Collapsed = 1024
Default = 256
Expanded = 512
ExtSelectable = 33554432
Floating = 4096
Focusable = 1048576
Focused = 4
HasPopup = 1073741824
HotTracked = 128
Indeterminate = 32
Invisible = 32768
Linked = 4194304
Marqueed = 8192
Mixed = 32
Moveable = 262144
MultiSelectable = 16777216
Normal = 0
Offscreen = 65536
Pressed = 8
Protected = 536870912
ReadOnly = 64
Selectable = 2097152
Selected = 2
SelfVoicing = 524288
Sizeable = 131072
Traversed = 8388608
Unavailable = 1
Valid = 2147483647

 
class AnnotationPattern(builtins.object)
    AnnotationPattern(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationannotationpattern

Readonly properties defined here:
AnnotationTypeId
Property AnnotationTypeId.
Call IUIAutomationAnnotationPattern::get_CurrentAnnotationTypeId.
Return int, a value in class `AnnotationType`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationannotationpattern-get_currentannotationtypeid
AnnotationTypeName
Property AnnotationTypeName.
Call IUIAutomationAnnotationPattern::get_CurrentAnnotationTypeName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationannotationpattern-get_currentannotationtypename
Author
Property Author.
Call IUIAutomationAnnotationPattern::get_CurrentAuthor.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationannotationpattern-get_currentauthor
DateTime
Property DateTime.
Call IUIAutomationAnnotationPattern::get_CurrentDateTime.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationannotationpattern-get_currentdatetime
Target
Property Target.
Call IUIAutomationAnnotationPattern::get_CurrentTarget.
Return `Control` subclass, the element that is being annotated.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationannotationpattern-get_currenttarget

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class AnnotationType(builtins.object)
    AnnotationType from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-annotation-type-identifiers
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AdvancedProofingIssue = 60020
Author = 60019
CircularReferenceError = 60022
Comment = 60003
ConflictingChange = 60018
DataValidationError = 60021
DeletionChange = 60012
EditingLockedChange = 60016
Endnote = 60009
ExternalChange = 60017
Footer = 60007
Footnote = 60010
FormatChange = 60014
FormulaError = 60004
GrammarError = 60002
Header = 60006
Highlighted = 60008
InsertionChange = 60011
Mathematics = 60023
MoveChange = 60013
SpellingError = 60001
TrackChanges = 60005
Unknown = 60000
UnsyncedChange = 60015

 
class AppBarControl(Control)
    AppBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
AppBarControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class Bitmap(builtins.object)
    Bitmap(width: int = 0, height: int = 0)
 
A simple Bitmap class wraps Windows GDI+ Gdiplus::Bitmap, but may not have high efficiency.
The color format is ARGB.
 
  Methods defined here:
Clear(self, color: int = 4294967295, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Set the color of rect(x,y,width,height).
color: int, ARGB color format.
x: int.
y: int.
width: int, if == 0, the width will be self.Width-x
height: int, if == 0, the height will be self.Height-y
Return bool.
Close(self) -> None
Close the underlying Gdiplus::Bitmap object.
Copy(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> 'Bitmap'
x: int, must >= 0.
y: int, must >= 0.
width: int, must <= self.Width-x.
height: int, must <= self.Height-y.
Return `Bitmap`, a new Bitmap copied from (x,y,width,height).
GetAllPixelColors(self) -> _ctypes.Array
Return `ctypes.Array`, an iterable array of int values in ARGB color format.
GetPixelColor(self, x: int, y: int) -> int
Get color value of a pixel.
x: int.
y: int.
Return int, ARGB color format.
b = argb & 0x0000FF
g = (argb & 0x00FF00) >> 8
r = (argb & 0xFF0000) >> 16
a = (argb & 0xFF0000) >> 24
GetPixelColorsHorizontally(self, x: int, y: int, count: int) -> _ctypes.Array
x: int.
y: int.
count: int.
Return `ctypes.Array`, an iterable array of int values in ARGB color format form point x,y horizontally.
GetPixelColorsOfColumn(self, x: int) -> _ctypes.Array
x: int, column index.
Return `ctypes.Array`, an iterable array of int values in ARGB color format of x column.
GetPixelColorsOfRect(self, x: int, y: int, width: int, height: int) -> _ctypes.Array
x: int.
y: int.
width: int.
height: int.
Return `ctypes.Array`, an iterable array of int values in ARGB color format of the input rect.
GetPixelColorsOfRects(self, rects: List[Tuple[int, int, int, int]]) -> List[_ctypes.Array]
rects: List[Tuple[int, int, int, int]], such as [(0,0,10,10), (10,10,20,20), (x,y,width,height)].
Return List[ctypes.Array], a list whose elements are ctypes.Array which is an iterable array of int values in ARGB color format.
GetPixelColorsOfRow(self, y: int) -> _ctypes.Array
y: int, row index.
Return `ctypes.Array`, an iterable array of int values in ARGB color format of y row.
GetPixelColorsVertically(self, x: int, y: int, count: int) -> _ctypes.Array
x: int.
y: int.
count: int.
Return `ctypes.Array`, an iterable array of int values in ARGB color format form point x,y vertically.
Paste(self, x: int, y: int, bitmap: 'Bitmap') -> bool
Paste bitmap to (x,y) of self, modify the original Bitmap,
    if x < 0 or x+bitmap.Width > self.Width, only the intersection part of bitmap is pasted,
    if y < 0 or y+bitmap.Height > self.Height, only the intersection part of bitmap is pasted.
x: int, can < 0.
y: int, can < 0.
bitmap: `Bitmap`.
Return bool, True if bitmap or a part of bitmap is pasted.
PastePart(self, dstX: int, dstY: int, srcBitmap: 'Bitmap', srcX: int = 0, srcY: int = 0, srcWidth: int = 0, srcHeight: int = 0) -> bool
Paste (srcX, srcY, srcWidth, srcHeight) of bitmap to (dstX, dstY) of self, modify the original Bitmap,
    only the intersection part of the bitmap is pasted.
dstX: int, must >= 0.
dstY: int, must >= 0.
srcBitmap: `Bitmap`.
srcX: int, must >= 0.
srcY: int, must >= 0.
srcWidth: int, must >= 0 and <= srcBitmap.Width - srcX.
srcHeight: int, must >= 0 and <= srcBitmap.Height - srcY.
Return bool, True if a part of srcBitmap is pasted.
Release = Close(self) -> None
Resize(self, width: int, height: int) -> 'Bitmap'
Resize a copy of the original to size (width, height), the original Bitmap is not modified.
width: int.
height: int.
Return a new `Bitmap`, the original is not modified.
Rotate(self, angle: int, backgroundColor: int = 4294967295) -> 'Bitmap'
Rotate a copy of the original with angle, the original Bitmap is not modified.
angle: int.
backgroundColor: int, ARGB color format.
Return a new `Bitmap`, the original is not modified.
RotateFlip(self, rotateFlip: int) -> 'Bitmap'
Rotate 90*n or Filp a copy of the original, the original Bitmap is not modified.
rotateFlip: int, a value in class `RotateFlipType`.
Return a new `Bitmap`, the original is not modified.
SetAllPixelColors(self, colors: Sequence[int]) -> bool
colors: Sequence[int], a sequence of int values in ARGB color format, it's length must equal to width*height,
    use ctypes.Array for better performance, such as `ctypes.c_uint32 * (width*height)`.
Return bool.
SetPixelColor(self, x: int, y: int, argb: int) -> bool
Set color value of a pixel.
x: int.
y: int.
argb: int, ARGB color format.
Return bool, True if succeed otherwise False.
SetPixelColorsHorizontally(self, x: int, y: int, colors: Sequence[int]) -> bool
Set pixel colors form x,y horizontally.
x: int.
y: int.
colors: Sequence[int], an iterable list of int color values in ARGB color format,
    use ctypes.Array for better performance, such as `ctypes.c_uint32 * length`.
Return bool, True if succeed otherwise False.
SetPixelColorsOfRect(self, x: int, y: int, width: int, height: int, colors: Sequence[int]) -> bool
x: int.
y: int.
width: int.
height: int.
colors: Sequence[int], a sequence of int values in ARGB color format, it's length must equal to width*height,
    use ctypes.Array for better performance, such as `ctypes.c_uint32 * (width*height)`.
Return bool.
SetPixelColorsVertically(self, x: int, y: int, colors: Sequence[int]) -> bool
Set pixel colors form x,y vertically.
x: int.
y: int.
colors: Sequence[int], an iterable list of int color values in ARGB color format,
    use ctypes.Array for better performance, such as `ctypes.c_uint32 * length`.
Return bool, True if succeed otherwise False.
ToFile(self, savePath: str) -> bool
Save to a file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
Return bool, True if succeed otherwise False.
__bool__(self)
__del__(self)
__enter__(self)
__exit__(self, exceptionType, exceptionValue, exceptionTraceback)
__init__(self, width: int = 0, height: int = 0)
Create a black transparent(ARGB=0x00000000) bimap of size(width, height).
__repr__(self) -> str
Return repr(self).
__str__(self) -> str
Return str(self).

Static methods defined here:
FromControl(control: 'Control', x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[ForwardRef('Bitmap')]
Create a `Bitmap` from a `Control`.
control: `Control` or its subclass.
x: int.
y: int.
width: int.
height: int.
x, y: the point in control's internal position(from 0,0)
width, height: image's width and height from x, y, use 0 for entire area,
If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return `Bitmap` or None.
FromFile(filePath: str) -> Optional[ForwardRef('Bitmap')]
Create a `Bitmap` from a file path.
filePath: str.
Return `Bitmap` or None.
FromHandle(hwnd: int, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0) -> Optional[ForwardRef('Bitmap')]
Create a `Bitmap` from a native window handle.
hwnd: int, the handle of a native window.
left: int.
top: int.
right: int.
bottom: int.
left, top, right and bottom are control's internal postion(from 0,0).
Return `Bitmap` or None.

Readonly properties defined here:
Height
Property Height.
Return int.
Width
Property Width.
Return int.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ButtonControl(Control)
    ButtonControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ButtonControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class CalendarControl(Control)
    CalendarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
CalendarControl
Control
builtins.object

Methods defined here:
GetGridPattern(self) -> uiautomation.GridPattern
Return `GridPattern` if it supports the pattern else None(Must support according to MSDN).
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTablePattern(self) -> uiautomation.TablePattern
Return `TablePattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class CheckBoxControl(Control)
    CheckBoxControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
CheckBoxControl
Control
builtins.object

Methods defined here:
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ClipboardFormat(builtins.object)
     Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
CF_BITMAP = 2
CF_DIB = 8
CF_DIBV5 = 17
CF_DIF = 5
CF_ENHMETAFILE = 14
CF_HDROP = 15
CF_HTML = 49343
CF_LOCALE = 16
CF_MAX = 18
CF_METAFILEPICT = 3
CF_OEMTEXT = 7
CF_PALETTE = 9
CF_PENDATA = 10
CF_RIFF = 11
CF_SYLK = 4
CF_TEXT = 1
CF_TIFF = 6
CF_UNICODETEXT = 13
CF_WAVE = 12

 
class ComboBoxControl(Control)
    ComboBoxControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ComboBoxControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Must support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
Select(self, itemName: str = '', condition: Optional[Callable[[str], bool]] = None, simulateMove: bool = True, waitTime: float = 0.5) -> bool
Show combobox's popup menu and select a item by name.
itemName: str.
condition: Callable[[str], bool], function(comboBoxItemName: str) -> bool, if condition is valid, ignore itemName.
waitTime: float.
Some comboboxs doesn't support SelectionPattern, here is a workaround.
This method tries to add selection support.
It may not work for some comboboxes, such as comboboxes in older Qt version.
If it doesn't work, you should write your own version Select, or it doesn't support selection at all.
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ConsoleColor(builtins.object)
    ConsoleColor from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Black = 0
Blue = 9
Cyan = 11
DarkBlue = 1
DarkCyan = 3
DarkGray = 8
DarkGreen = 2
DarkMagenta = 5
DarkRed = 4
DarkYellow = 6
Default = -1
Gray = 7
Green = 10
Magenta = 13
Red = 12
White = 15
Yellow = 14

 
class ConsoleScreenBufferInfo(_ctypes.Structure)
    
Method resolution order:
ConsoleScreenBufferInfo
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
dwCursorPosition
dwMaximumWindowSize
dwSize
srWindow
wAttributes

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
class Control(builtins.object)
    Control(searchFromControl: Optional[ForwardRef('Control')] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
  Methods defined here:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__init__(self, searchFromControl: Optional[ForwardRef('Control')] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement
__str__(self) -> str
Return str(self).

Static methods defined here:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties defined here:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ControlType(builtins.object)
    ControlType from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-controltype-ids
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AppBarControl = 50040
ButtonControl = 50000
CalendarControl = 50001
CheckBoxControl = 50002
ComboBoxControl = 50003
CustomControl = 50025
DataGridControl = 50028
DataItemControl = 50029
DocumentControl = 50030
EditControl = 50004
GroupControl = 50026
HeaderControl = 50034
HeaderItemControl = 50035
HyperlinkControl = 50005
ImageControl = 50006
ListControl = 50008
ListItemControl = 50007
MenuBarControl = 50010
MenuControl = 50009
MenuItemControl = 50011
PaneControl = 50033
ProgressBarControl = 50012
RadioButtonControl = 50013
ScrollBarControl = 50014
SemanticZoomControl = 50039
SeparatorControl = 50038
SliderControl = 50015
SpinnerControl = 50016
SplitButtonControl = 50031
StatusBarControl = 50017
TabControl = 50018
TabItemControl = 50019
TableControl = 50036
TextControl = 50020
ThumbControl = 50027
TitleBarControl = 50037
ToolBarControl = 50021
ToolTipControl = 50022
TreeControl = 50023
TreeItemControl = 50024
WindowControl = 50032

 
class CustomControl(Control)
    CustomControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
CustomControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class CustomNavigationPattern(builtins.object)
    CustomNavigationPattern(pattern=None)
 

 
  Methods defined here:
Navigate(self, direction: int) -> 'Control'
Call IUIAutomationCustomNavigationPattern::Navigate.
Get the next control in the specified direction within the logical UI tree.
direction: int, a value in class `NavigateDirection`.
Return `Control` subclass or None.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationcustomnavigationpattern-navigate
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationcustomnavigationpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class DataGridControl(Control)
    DataGridControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
DataGridControl
Control
builtins.object

Methods defined here:
GetGridPattern(self) -> uiautomation.GridPattern
Return `GridPattern` if it supports the pattern else None(Must support according to MSDN).
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTablePattern(self) -> uiautomation.TablePattern
Return `TablePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class DataItemControl(Control)
    DataItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
DataItemControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetGridItemPattern(self) -> uiautomation.GridItemPattern
Return `GridItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetScrollItemPattern(self) -> uiautomation.ScrollItemPattern
Return `ScrollItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Must support according to MSDN).
GetTableItemPattern(self) -> uiautomation.TableItemPattern
Return `TableItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class DockPattern(builtins.object)
    DockPattern(pattern=None)
 

 
  Methods defined here:
SetDockPosition(self, dockPosition: int, waitTime: float = 0.5) -> int
Call IUIAutomationDockPattern::SetDockPosition.
dockPosition: int, a value in class `DockPosition`.
waitTime: float.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdockpattern-setdockposition
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationdockpattern

Readonly properties defined here:
DockPosition
Property DockPosition.
Call IUIAutomationDockPattern::get_CurrentDockPosition.
Return int, a value in class `DockPosition`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdockpattern-get_currentdockposition

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class DockPosition(builtins.object)
    DockPosition from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-dockposition
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Bottom = 2
Fill = 4
Left = 1
None_ = 5
Right = 3
Top = 0

 
class DocumentControl(Control)
    DocumentControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
DocumentControl
Control
builtins.object

Methods defined here:
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTextPattern(self) -> uiautomation.TextPattern
Return `TextPattern` if it supports the pattern else None(Must support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class DpiAwarenessContext(builtins.object)
     Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
PerMonitorAware = -3
PerMonitorAwareV2 = -4
SystemAware = -2
Unaware = -1
UnawareGdiScaled = -5

 
class DragPattern(builtins.object)
    DragPattern(pattern=None)
 

 
  Methods defined here:
GetGrabbedItems(self) -> List[ForwardRef('Control')]
Call IUIAutomationDragPattern::GetCurrentGrabbedItems.
Return List[Control], a list of `Control` subclasses that represent the full set of items
             that the user is dragging as part of a drag operation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-getcurrentgrabbeditems
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationdragpattern

Readonly properties defined here:
DropEffect
Property DropEffect.
Call IUIAutomationDragPattern::get_CurrentDropEffect.
Return str, a localized string that indicates what happens
            when the user drops this element as part of a drag-drop operation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-get_currentdropeffect
DropEffects
Property DropEffects.
Call IUIAutomationDragPattern::get_CurrentDropEffects, todo SAFEARRAY.
Return List[str], a list of localized strings that enumerate the full set of effects
             that can happen when this element as part of a drag-and-drop operation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-get_currentdropeffects
IsGrabbed
Property IsGrabbed.
Call IUIAutomationDragPattern::get_CurrentIsGrabbed.
Return bool, indicates whether the user has grabbed this element as part of a drag-and-drop operation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-get_currentisgrabbed

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class DropTargetPattern(builtins.object)
    DropTargetPattern(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationdroptargetpattern

Readonly properties defined here:
DropTargetEffect
Property DropTargetEffect.
Call IUIAutomationDropTargetPattern::get_CurrentDropTargetEffect.
Return str, a localized string that describes what happens
            when the user drops the grabbed element on this drop target.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-get_currentdroptargeteffect
DropTargetEffects
Property DropTargetEffects.
Call IUIAutomationDropTargetPattern::get_CurrentDropTargetEffects, todo SAFEARRAY.
Return List[str], a list of localized strings that enumerate the full set of effects
             that can happen when the user drops a grabbed element on this drop target
             as part of a drag-and-drop operation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationdragpattern-get_currentdroptargeteffects

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class EditControl(Control)
    EditControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
EditControl
Control
builtins.object

Methods defined here:
GetRangeValuePattern(self) -> uiautomation.RangeValuePattern
Return `RangeValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTextPattern(self) -> uiautomation.TextPattern
Return `TextPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ExpandCollapsePattern(builtins.object)
    ExpandCollapsePattern(pattern=None)
 

 
  Methods defined here:
Collapse(self, waitTime: float = 0.5) -> bool
Call IUIAutomationExpandCollapsePattern::Collapse.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationexpandcollapsepattern-collapse
Expand(self, waitTime: float = 0.5) -> bool
Call IUIAutomationExpandCollapsePattern::Expand.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationexpandcollapsepattern-expand
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationexpandcollapsepattern

Readonly properties defined here:
ExpandCollapseState
Property ExpandCollapseState.
Call IUIAutomationExpandCollapsePattern::get_CurrentExpandCollapseState.
Return int, a value in class ExpandCollapseState.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationexpandcollapsepattern-get_currentexpandcollapsestate

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ExpandCollapseState(builtins.object)
    ExpandCollapseState from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-expandcollapsestate
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Collapsed = 0
Expanded = 1
LeafNode = 3
PartiallyExpanded = 2

 
class GAFlag(builtins.object)
    GAFlag from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Parent = 1
Root = 2
RootOwner = 3

 
class GWL(builtins.object)
     Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ExStyle = -20
HInstance = -6
HwndParent = -8
ID = -12
Style = -16
UserData = -21
WndProc = -4

 
class GridItemPattern(builtins.object)
    GridItemPattern(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationgriditempattern

Readonly properties defined here:
Column
Property Column.
Call IUIAutomationGridItemPattern::get_CurrentColumn.
Return int, the zero-based index of the column that contains the item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgriditempattern-get_currentcolumn
ColumnSpan
Property ColumnSpan.
Call IUIAutomationGridItemPattern::get_CurrentColumnSpan.
Return int, the number of columns spanned by the grid item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgriditempattern-get_currentcolumnspan
ContainingGrid
Property ContainingGrid.
Call IUIAutomationGridItemPattern::get_CurrentContainingGrid.
Return `Control` subclass, the element that contains the grid item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgriditempattern-get_currentcontaininggrid
Row
Property Row.
Call IUIAutomationGridItemPattern::get_CurrentRow.
Return int, the zero-based index of the row that contains the grid item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgriditempattern-get_currentrow
RowSpan
Property RowSpan.
Call IUIAutomationGridItemPattern::get_CurrentRowSpan.
Return int, the number of rows spanned by the grid item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgriditempattern-get_currentrowspan

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class GridPattern(builtins.object)
    GridPattern(pattern=None)
 

 
  Methods defined here:
GetItem(self, row: int, column: int) -> 'Control'
Call IUIAutomationGridPattern::GetItem.
Return `Control` subclass, a control representing an item in the grid.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgridpattern-getitem
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationgridpattern

Readonly properties defined here:
ColumnCount
Property ColumnCount.
Call IUIAutomationGridPattern::get_CurrentColumnCount.
Return int, the number of columns in the grid.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgridpattern-get_currentcolumncount
RowCount
Property RowCount.
Call IUIAutomationGridPattern::get_CurrentRowCount.
Return int, the number of rows in the grid.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationgridpattern-get_currentrowcount

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class GroupControl(Control)
    GroupControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
GroupControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class HARDWAREINPUT(_ctypes.Structure)
    
Method resolution order:
HARDWAREINPUT
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
uMsg
wParamH
wParamL

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
class HeaderControl(Control)
    HeaderControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
HeaderControl
Control
builtins.object

Methods defined here:
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class HeaderItemControl(Control)
    HeaderItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
HeaderItemControl
Control
builtins.object

Methods defined here:
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class HyperlinkControl(Control)
    HyperlinkControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
HyperlinkControl
Control
builtins.object

Methods defined here:
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Must support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class INPUT(_ctypes.Structure)
    
Method resolution order:
INPUT
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
type
union

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
class ImageControl(Control)
    ImageControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ImageControl
Control
builtins.object

Methods defined here:
GetGridItemPattern(self) -> uiautomation.GridItemPattern
Return `GridItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTableItemPattern(self) -> uiautomation.TableItemPattern
Return `TableItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class InputType(builtins.object)
    InputType from Win32
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Hardware = 2
Keyboard = 1
Mouse = 0

 
class InvokePattern(builtins.object)
    InvokePattern(pattern=None)
 

 
  Methods defined here:
Invoke(self, waitTime: float = 0.5) -> bool
Call IUIAutomationInvokePattern::Invoke.
Invoke the action of a control, such as a button click.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationinvokepattern-invoke
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationinvokepattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ItemContainerPattern(builtins.object)
    ItemContainerPattern(pattern=None)
 

 
  Methods defined here:
FindItemByProperty(self, control: 'Control', propertyId: int, propertyValue) -> 'Control'
Call IUIAutomationItemContainerPattern::FindItemByProperty.
control: `Control` or its subclass.
propertyValue: COM VARIANT according to propertyId? todo.
propertyId: int, a value in class `PropertyId`.
Return `Control` subclass, a control within a containing element, based on a specified property value.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationitemcontainerpattern-finditembyproperty
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationitemcontainerpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class KEYBDINPUT(_ctypes.Structure)
    
Method resolution order:
KEYBDINPUT
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
dwExtraInfo
dwFlags
time
wScan
wVk

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
class KeyboardEventFlag(builtins.object)
    KeyboardEventFlag from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ExtendedKey = 1
KeyDown = 0
KeyScanCode = 8
KeyUnicode = 4
KeyUp = 2

 
class Keys(builtins.object)
    Key codes from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
VK_0 = 48
VK_1 = 49
VK_2 = 50
VK_3 = 51
VK_4 = 52
VK_5 = 53
VK_6 = 54
VK_7 = 55
VK_8 = 56
VK_9 = 57
VK_A = 65
VK_ACCEPT = 30
VK_ADD = 107
VK_APPS = 93
VK_ATTN = 246
VK_B = 66
VK_BACK = 8
VK_BROWSER_BACK = 166
VK_BROWSER_FAVORITES = 171
VK_BROWSER_FORWARD = 167
VK_BROWSER_HOME = 172
VK_BROWSER_REFRESH = 168
VK_BROWSER_SEARCH = 170
VK_BROWSER_STOP = 169
VK_C = 67
VK_CANCEL = 3
VK_CAPITAL = 20
VK_CLEAR = 12
VK_CONTROL = 17
VK_CONVERT = 28
VK_CRSEL = 247
VK_D = 68
VK_DECIMAL = 110
VK_DELETE = 46
VK_DIVIDE = 111
VK_DOWN = 40
VK_E = 69
VK_END = 35
VK_ENTER = 13
VK_EREOF = 249
VK_ESCAPE = 27
VK_EXECUTE = 43
VK_EXSEL = 248
VK_F = 70
VK_F1 = 112
VK_F10 = 121
VK_F11 = 122
VK_F12 = 123
VK_F13 = 124
VK_F14 = 125
VK_F15 = 126
VK_F16 = 127
VK_F17 = 128
VK_F18 = 129
VK_F19 = 130
VK_F2 = 113
VK_F20 = 131
VK_F21 = 132
VK_F22 = 133
VK_F23 = 134
VK_F24 = 135
VK_F3 = 114
VK_F4 = 115
VK_F5 = 116
VK_F6 = 117
VK_F7 = 118
VK_F8 = 119
VK_F9 = 120
VK_FINAL = 24
VK_G = 71
VK_H = 72
VK_HANGUEL = 21
VK_HANGUL = 21
VK_HANJA = 25
VK_HELP = 47
VK_HOME = 36
VK_I = 73
VK_INSERT = 45
VK_J = 74
VK_JUNJA = 23
VK_K = 75
VK_KANA = 21
VK_KANJI = 25
VK_L = 76
VK_LAUNCH_APP1 = 182
VK_LAUNCH_APP2 = 183
VK_LAUNCH_MAIL = 180
VK_LAUNCH_MEDIA_SELECT = 181
VK_LBUTTON = 1
VK_LCONTROL = 162
VK_LEFT = 37
VK_LMENU = 164
VK_LSHIFT = 160
VK_LWIN = 91
VK_M = 77
VK_MBUTTON = 4
VK_MEDIA_NEXT_TRACK = 176
VK_MEDIA_PLAY_PAUSE = 179
VK_MEDIA_PREV_TRACK = 177
VK_MEDIA_STOP = 178
VK_MENU = 18
VK_MODECHANGE = 31
VK_MULTIPLY = 106
VK_N = 78
VK_NEXT = 34
VK_NONAME = 252
VK_NONCONVERT = 29
VK_NUMLOCK = 144
VK_NUMPAD0 = 96
VK_NUMPAD1 = 97
VK_NUMPAD2 = 98
VK_NUMPAD3 = 99
VK_NUMPAD4 = 100
VK_NUMPAD5 = 101
VK_NUMPAD6 = 102
VK_NUMPAD7 = 103
VK_NUMPAD8 = 104
VK_NUMPAD9 = 105
VK_O = 79
VK_OEM_1 = 186
VK_OEM_102 = 226
VK_OEM_2 = 191
VK_OEM_3 = 192
VK_OEM_4 = 219
VK_OEM_5 = 220
VK_OEM_6 = 221
VK_OEM_7 = 222
VK_OEM_8 = 223
VK_OEM_CLEAR = 254
VK_OEM_COMMA = 188
VK_OEM_MINUS = 189
VK_OEM_PERIOD = 190
VK_OEM_PLUS = 187
VK_P = 80
VK_PA1 = 253
VK_PACKET = 231
VK_PAGEDOWN = 34
VK_PAGEUP = 33
VK_PAUSE = 19
VK_PLAY = 250
VK_PRINT = 42
VK_PRIOR = 33
VK_PROCESSKEY = 229
VK_Q = 81
VK_R = 82
VK_RBUTTON = 2
VK_RCONTROL = 163
VK_RETURN = 13
VK_RIGHT = 39
VK_RMENU = 165
VK_RSHIFT = 161
VK_RWIN = 92
VK_S = 83
VK_SCROLL = 145
VK_SELECT = 41
VK_SEPARATOR = 108
VK_SHIFT = 16
VK_SLEEP = 95
VK_SNAPSHOT = 44
VK_SPACE = 32
VK_SUBTRACT = 109
VK_T = 84
VK_TAB = 9
VK_U = 85
VK_UP = 38
VK_V = 86
VK_VOLUME_DOWN = 174
VK_VOLUME_MUTE = 173
VK_VOLUME_UP = 175
VK_W = 87
VK_X = 88
VK_XBUTTON1 = 5
VK_XBUTTON2 = 6
VK_Y = 89
VK_Z = 90
VK_ZOOM = 251

 
class LegacyIAccessiblePattern(builtins.object)
    LegacyIAccessiblePattern(pattern=None)
 

 
  Methods defined here:
DoDefaultAction(self, waitTime: float = 0.5) -> bool
Call IUIAutomationLegacyIAccessiblePattern::DoDefaultAction.
Perform the Microsoft Active Accessibility default action for the element.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-dodefaultaction
GetIAccessible(self)
Call IUIAutomationLegacyIAccessiblePattern::GetIAccessible, todo.
Return an IAccessible object that corresponds to the Microsoft UI Automation element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-getiaccessible
Refer https://docs.microsoft.com/en-us/windows/win32/api/oleacc/nn-oleacc-iaccessible
GetSelection(self) -> List[ForwardRef('Control')]
Call IUIAutomationLegacyIAccessiblePattern::GetCurrentSelection.
Return List[Control], a list of `Control` subclasses,
             the Microsoft Active Accessibility property that identifies the selected children of this element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-getcurrentselection
Select(self, flagsSelect: int, waitTime: float = 0.5) -> bool
Call IUIAutomationLegacyIAccessiblePattern::Select.
Perform a Microsoft Active Accessibility selection.
flagsSelect: int, a value in `AccessibleSelection`.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-select
SetValue(self, value: str, waitTime: float = 0.5) -> bool
Call IUIAutomationLegacyIAccessiblePattern::SetValue.
Set the Microsoft Active Accessibility value property for the element.
value: str.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-setvalue
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationlegacyiaccessiblepattern

Readonly properties defined here:
ChildId
Property ChildId.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentChildId.
Return int, the Microsoft Active Accessibility child identifier for the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentchildid
DefaultAction
Property DefaultAction.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentDefaultAction.
Return str, the Microsoft Active Accessibility current default action for the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentdefaultaction
Description
Property Description.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentDescription.
Return str, the Microsoft Active Accessibility description of the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentdescription
Help
Property Help.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentHelp.
Return str, the Microsoft Active Accessibility help string for the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currenthelp
KeyboardShortcut
Property KeyboardShortcut.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentKeyboardShortcut.
Return str, the Microsoft Active Accessibility keyboard shortcut property for the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentkeyboardshortcut
Name
Property Name.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentName.
Return str, the Microsoft Active Accessibility name property of the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentname
Role
Property Role.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentRole.
Return int, a value in calss `AccessibleRole`, the Microsoft Active Accessibility role identifier.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentrole
State
Property State.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentState.
Return int, a value in calss `AccessibleState`, the Microsoft Active Accessibility state identifier.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentstate
Value
Property Value.
Call IUIAutomationLegacyIAccessiblePattern::get_CurrentValue.
Return str, the Microsoft Active Accessibility value property.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationlegacyiaccessiblepattern-get_currentvalue

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ListControl(Control)
    ListControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ListControl
Control
builtins.object

Methods defined here:
GetGridPattern(self) -> uiautomation.GridPattern
Return `GridPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetMultipleViewPattern(self) -> uiautomation.MultipleViewPattern
Return `MultipleViewPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ListItemControl(Control)
    ListItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ListItemControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetGridItemPattern(self) -> uiautomation.GridItemPattern
Return `GridItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetScrollItemPattern(self) -> uiautomation.ScrollItemPattern
Return `ScrollItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Must support according to MSDN).
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class Logger(builtins.object)
    Logger for print and log. Support for printing log with different colors on console.
 
  Static methods defined here:
ColorfullyLog(log: str = '', consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: any type.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
 
ColorfullyLog('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.
ColorfullyWrite(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: str.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
ColorfullyWrite('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.
ColorfullyWriteLine(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: str.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
 
ColorfullyWriteLine('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.
DeleteLog() -> None
Delete log file.
Log(log: Any = '', consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: any type.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
LogColorfully = ColorfullyLog(log: str = '', consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: any type.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
 
ColorfullyLog('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.
SetLogFile(logFile: Union[_io.TextIOWrapper, str]) -> None
logFile: file object or str.
If logFile is '', no log file will be written.
The previous log file will be closed immediately.
Write(log: Any, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None, printTruncateLen: int = 0) -> None
log: any type.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
printTruncateLen: int, if <= 0, log is not truncated when print.
WriteColorfully = ColorfullyWrite(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: str.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
ColorfullyWrite('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.
WriteLine(log: Any, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: any type.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
WriteLineColorfully = ColorfullyWriteLine(log: str, consoleColor: int = -1, writeToFile: bool = True, printToStdout: bool = True, logFile: Optional[str] = None) -> None
log: str.
consoleColor: int, a value in class `ConsoleColor`, such as `ConsoleColor.DarkGreen`.
writeToFile: bool.
printToStdout: bool.
logFile: str, log file path.
 
ColorfullyWriteLine('Hello <Color=Green>Green Text</Color> !!!'), Color name must be in `Logger.ColorNames` and can't be nested.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ColorNames = {'Black': 0, 'Blue': 9, 'Cyan': 11, 'DarkBlue': 1, 'DarkCyan': 3, 'DarkGray': 8, 'DarkGreen': 2, 'DarkMagenta': 5, 'DarkRed': 4, 'DarkYellow': 6, ...}
FileObj = None
FilePath = '@AutomationLog.txt'
FlushTime = 1140369.6983334

 
class MB(builtins.object)
    MessageBox flags from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AbortRetryIgnore = 2
ApplModal = 0
CancelTryContinue = 6
DefButton1 = 0
DefButton2 = 256
DefButton3 = 512
DefButton4 = 768
DefMask = 3840
DefaultDesktopOnly = 131072
Help = 16384
IconAsterisk = 64
IconError = 16
IconExclamation = 48
IconHand = 16
IconInformation = 64
IconMask = 240
IconQuestion = 32
IconStop = 16
IconWarning = 48
IdAbort = 3
IdCancel = 2
IdClose = 8
IdContinue = 11
IdHelp = 9
IdIgnore = 5
IdNo = 7
IdOk = 1
IdRetry = 4
IdTimeout = 32000
IdTryAgain = 10
IdYes = 6
MiscMask = 49152
ModeMask = 12288
NoFocus = 32768
Ok = 0
OkCancel = 1
RetryCancel = 5
Right = 524288
RtlReading = 1048576
ServiceNotification = 2097152
ServiceNotificationNT3X = 262144
SetForeground = 65536
SystemModal = 4096
TaskModal = 8192
Topmost = 262144
TypeMask = 15
UserIcon = 128
YesNo = 4
YesNoCancel = 3

 
class MOUSEINPUT(_ctypes.Structure)
    
Method resolution order:
MOUSEINPUT
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
dwExtraInfo
dwFlags
dx
dy
mouseData
time

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
class MenuBarControl(Control)
    MenuBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
MenuBarControl
Control
builtins.object

Methods defined here:
GetDockPattern(self) -> uiautomation.DockPattern
Return `DockPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class MenuControl(Control)
    MenuControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
MenuControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class MenuItemControl(Control)
    MenuItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
MenuItemControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ModifierKey(builtins.object)
    ModifierKey from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Alt = 1
Control = 2
NoRepeat = 16384
Shift = 4
Win = 8

 
class MouseEventFlag(builtins.object)
    MouseEventFlag from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Absolute = 32768
HWheel = 4096
LeftDown = 2
LeftUp = 4
MiddleDown = 32
MiddleUp = 64
Move = 1
MoveNoCoalesce = 8192
RightDown = 8
RightUp = 16
VirtualDesk = 16384
Wheel = 2048
XDown = 128
XUp = 256

 
class MultipleViewPattern(builtins.object)
    MultipleViewPattern(pattern=None)
 

 
  Methods defined here:
GetSupportedViews(self) -> List[int]
Call IUIAutomationMultipleViewPattern::GetCurrentSupportedViews, todo.
Return List[int], a list of int, control-specific view identifiers.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationmultipleviewpattern-getcurrentsupportedviews
GetViewName(self, view: int) -> str
Call IUIAutomationMultipleViewPattern::GetViewName.
view: int, the control-specific view identifier.
Return str, the name of a control-specific view.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationmultipleviewpattern-getviewname
SetView(self, view: int) -> bool
Call IUIAutomationMultipleViewPattern::SetCurrentView.
Set the view of the control.
view: int, the control-specific view identifier.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationmultipleviewpattern-setcurrentview
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationmultipleviewpattern

Readonly properties defined here:
CurrentView
Property CurrentView.
Call IUIAutomationMultipleViewPattern::get_CurrentCurrentView.
Return int, the control-specific identifier of the current view of the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationmultipleviewpattern-get_currentcurrentview

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class NavigateDirection(builtins.object)
    NavigateDirection from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-navigatedirection
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
FirstChild = 3
LastChild = 4
NextSibling = 1
Parent = 0
PreviousSibling = 2

 
class ObjectModelPattern(builtins.object)
    ObjectModelPattern(pattern=None)
 

 
  Methods defined here:
GetUnderlyingObjectModel(self) -> comtypes.POINTER(IUnknown)
Call IUIAutomationObjectModelPattern::GetUnderlyingObjectModel, todo.
Return `ctypes.POINTER(comtypes.IUnknown)`, an interface used to access the underlying object model of the provider.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationobjectmodelpattern-getunderlyingobjectmodel
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationobjectmodelpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class OrientationType(builtins.object)
    OrientationType from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-orientationtype
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Horizontal = 1
None_ = 0
Vertical = 2

 
class PaneControl(Control, TopLevel)
    PaneControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
PaneControl
Control
TopLevel
builtins.object

Methods defined here:
GetDockPattern(self) -> uiautomation.DockPattern
Return `DockPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

Methods inherited from TopLevel:
IsMaximize(self) -> bool
IsMinimize(self) -> bool
IsTopmost(self) -> bool
Maximize(self, waitTime: float = 0.5) -> bool
Set top level window maximize.
Minimize(self, waitTime: float = 0.5) -> bool
MoveToCenter(self) -> bool
Move window to screen center.
Restore(self, waitTime: float = 0.5) -> bool
Restore window to normal state.
Similar to SwitchToThisWindow.
SetActive(self, waitTime: float = 0.5) -> bool
Set top level window active.
SetTopmost(self, isTopmost: bool = True, waitTime: float = 0.5) -> bool
Set top level window topmost.
isTopmost: bool.
waitTime: float.
SwitchToThisWindow(self, waitTime: float = 0.5) -> None

 
class PatternId(builtins.object)
    PatternId from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-controlpattern-ids
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AnnotationPattern = 10023
CustomNavigationPattern = 10033
DockPattern = 10011
DragPattern = 10030
DropTargetPattern = 10031
ExpandCollapsePattern = 10005
GridItemPattern = 10007
GridPattern = 10006
InvokePattern = 10000
ItemContainerPattern = 10019
LegacyIAccessiblePattern = 10018
MultipleViewPattern = 10008
ObjectModelPattern = 10022
RangeValuePattern = 10003
ScrollItemPattern = 10017
ScrollPattern = 10004
SelectionItemPattern = 10010
SelectionPattern = 10001
SpreadsheetItemPattern = 10027
SpreadsheetPattern = 10026
StylesPattern = 10025
SynchronizedInputPattern = 10021
TableItemPattern = 10013
TablePattern = 10012
TextChildPattern = 10029
TextEditPattern = 10032
TextPattern = 10014
TextPattern2 = 10024
TogglePattern = 10015
TransformPattern = 10016
TransformPattern2 = 10028
ValuePattern = 10002
VirtualizedItemPattern = 10020
WindowPattern = 10009

 
class ProcessDpiAwareness(builtins.object)
     Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
DpiUnaware = 0
PerMonitorDpiAware = 2
SystemDpiAware = 1

 
class ProcessInfo(builtins.object)
    ProcessInfo(exeName: str, pid: int, ppid: int = -1, exePath: str = '', cmdLine: str = '')
 

 
  Methods defined here:
__init__(self, exeName: str, pid: int, ppid: int = -1, exePath: str = '', cmdLine: str = '')
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self)
Return repr(self).
__str__(self)
Return str(self).

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ProgressBarControl(Control)
    ProgressBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ProgressBarControl
Control
builtins.object

Methods defined here:
GetRangeValuePattern(self) -> uiautomation.RangeValuePattern
Return `RangeValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class PropertyId(builtins.object)
    PropertyId from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-control-pattern-propids
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AcceleratorKeyProperty = 30006
AccessKeyProperty = 30007
AnnotationAnnotationTypeIdProperty = 30113
AnnotationAnnotationTypeNameProperty = 30114
AnnotationAuthorProperty = 30115
AnnotationDateTimeProperty = 30116
AnnotationObjectsProperty = 30156
AnnotationTargetProperty = 30117
AnnotationTypesProperty = 30155
AriaPropertiesProperty = 30102
AriaRoleProperty = 30101
AutomationIdProperty = 30011
BoundingRectangleProperty = 30001
CenterPointProperty = 30165
ClassNameProperty = 30012
ClickablePointProperty = 30014
ControlTypeProperty = 30003
ControllerForProperty = 30104
CultureProperty = 30015
DescribedByProperty = 30105
DockDockPositionProperty = 30069
DragDropEffectProperty = 30139
DragDropEffectsProperty = 30140
DragGrabbedItemsProperty = 30144
DragIsGrabbedProperty = 30138
DropTargetDropTargetEffectProperty = 30142
DropTargetDropTargetEffectsProperty = 30143
ExpandCollapseExpandCollapseStateProperty = 30070
FillColorProperty = 30160
FillTypeProperty = 30162
FlowsFromProperty = 30148
FlowsToProperty = 30106
FrameworkIdProperty = 30024
FullDescriptionProperty = 30159
GridColumnCountProperty = 30063
GridItemColumnProperty = 30065
GridItemColumnSpanProperty = 30067
GridItemContainingGridProperty = 30068
GridItemRowProperty = 30064
GridItemRowSpanProperty = 30066
GridRowCountProperty = 30062
HasKeyboardFocusProperty = 30008
HelpTextProperty = 30013
IsAnnotationPatternAvailableProperty = 30118
IsContentElementProperty = 30017
IsControlElementProperty = 30016
IsCustomNavigationPatternAvailableProperty = 30151
IsDataValidForFormProperty = 30103
IsDockPatternAvailableProperty = 30027
IsDragPatternAvailableProperty = 30137
IsDropTargetPatternAvailableProperty = 30141
IsEnabledProperty = 30010
IsExpandCollapsePatternAvailableProperty = 30028
IsGridItemPatternAvailableProperty = 30029
IsGridPatternAvailableProperty = 30030
IsInvokePatternAvailableProperty = 30031
IsItemContainerPatternAvailableProperty = 30108
IsKeyboardFocusableProperty = 30009
IsLegacyIAccessiblePatternAvailableProperty = 30090
IsMultipleViewPatternAvailableProperty = 30032
IsObjectModelPatternAvailableProperty = 30112
IsOffscreenProperty = 30022
IsPasswordProperty = 30019
IsPeripheralProperty = 30150
IsRangeValuePatternAvailableProperty = 30033
IsRequiredForFormProperty = 30025
IsScrollItemPatternAvailableProperty = 30035
IsScrollPatternAvailableProperty = 30034
IsSelectionItemPatternAvailableProperty = 30036
IsSelectionPattern2AvailableProperty = 30168
IsSelectionPatternAvailableProperty = 30037
IsSpreadsheetItemPatternAvailableProperty = 30132
IsSpreadsheetPatternAvailableProperty = 30128
IsStylesPatternAvailableProperty = 30127
IsSynchronizedInputPatternAvailableProperty = 30110
IsTableItemPatternAvailableProperty = 30039
IsTablePatternAvailableProperty = 30038
IsTextChildPatternAvailableProperty = 30136
IsTextEditPatternAvailableProperty = 30149
IsTextPattern2AvailableProperty = 30119
IsTextPatternAvailableProperty = 30040
IsTogglePatternAvailableProperty = 30041
IsTransformPattern2AvailableProperty = 30134
IsTransformPatternAvailableProperty = 30042
IsValuePatternAvailableProperty = 30043
IsVirtualizedItemPatternAvailableProperty = 30109
IsWindowPatternAvailableProperty = 30044
ItemStatusProperty = 30026
ItemTypeProperty = 30021
LabeledByProperty = 30018
LandmarkTypeProperty = 30157
LegacyIAccessibleChildIdProperty = 30091
LegacyIAccessibleDefaultActionProperty = 30100
LegacyIAccessibleDescriptionProperty = 30094
LegacyIAccessibleHelpProperty = 30097
LegacyIAccessibleKeyboardShortcutProperty = 30098
LegacyIAccessibleNameProperty = 30092
LegacyIAccessibleRoleProperty = 30095
LegacyIAccessibleSelectionProperty = 30099
LegacyIAccessibleStateProperty = 30096
LegacyIAccessibleValueProperty = 30093
LevelProperty = 30154
LiveSettingProperty = 30135
LocalizedControlTypeProperty = 30004
LocalizedLandmarkTypeProperty = 30158
MultipleViewCurrentViewProperty = 30071
MultipleViewSupportedViewsProperty = 30072
NameProperty = 30005
NativeWindowHandleProperty = 30020
OptimizeForVisualContentProperty = 30111
OrientationProperty = 30023
OutlineColorProperty = 30161
OutlineThicknessProperty = 30164
PositionInSetProperty = 30152
ProcessIdProperty = 30002
ProviderDescriptionProperty = 30107
RangeValueIsReadOnlyProperty = 30048
RangeValueLargeChangeProperty = 30051
RangeValueMaximumProperty = 30050
RangeValueMinimumProperty = 30049
RangeValueSmallChangeProperty = 30052
RangeValueValueProperty = 30047
RotationProperty = 30166
RuntimeIdProperty = 30000
ScrollHorizontalScrollPercentProperty = 30053
ScrollHorizontalViewSizeProperty = 30054
ScrollHorizontallyScrollableProperty = 30057
ScrollVerticalScrollPercentProperty = 30055
ScrollVerticalViewSizeProperty = 30056
ScrollVerticallyScrollableProperty = 30058
Selection2CurrentSelectedItemProperty = 30171
Selection2FirstSelectedItemProperty = 30169
Selection2ItemCountProperty = 30172
Selection2LastSelectedItemProperty = 30170
SelectionCanSelectMultipleProperty = 30060
SelectionIsSelectionRequiredProperty = 30061
SelectionItemIsSelectedProperty = 30079
SelectionItemSelectionContainerProperty = 30080
SelectionSelectionProperty = 30059
SizeOfSetProperty = 30153
SizeProperty = 30167
SpreadsheetItemAnnotationObjectsProperty = 30130
SpreadsheetItemAnnotationTypesProperty = 30131
SpreadsheetItemFormulaProperty = 30129
StylesExtendedPropertiesProperty = 30126
StylesFillColorProperty = 30122
StylesFillPatternColorProperty = 30125
StylesFillPatternStyleProperty = 30123
StylesShapeProperty = 30124
StylesStyleIdProperty = 30120
StylesStyleNameProperty = 30121
TableColumnHeadersProperty = 30082
TableItemColumnHeaderItemsProperty = 30085
TableItemRowHeaderItemsProperty = 30084
TableRowHeadersProperty = 30081
TableRowOrColumnMajorProperty = 30083
ToggleToggleStateProperty = 30086
Transform2CanZoomProperty = 30133
Transform2ZoomLevelProperty = 30145
Transform2ZoomMaximumProperty = 30147
Transform2ZoomMinimumProperty = 30146
TransformCanMoveProperty = 30087
TransformCanResizeProperty = 30088
TransformCanRotateProperty = 30089
ValueIsReadOnlyProperty = 30046
ValueValueProperty = 30045
VisualEffectsProperty = 30163
WindowCanMaximizeProperty = 30073
WindowCanMinimizeProperty = 30074
WindowIsModalProperty = 30077
WindowIsTopmostProperty = 30078
WindowWindowInteractionStateProperty = 30076
WindowWindowVisualStateProperty = 30075

 
class RadioButtonControl(Control)
    RadioButtonControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
RadioButtonControl
Control
builtins.object

Methods defined here:
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class RangeValuePattern(builtins.object)
    RangeValuePattern(pattern=None)
 

 
  Methods defined here:
SetValue(self, value: float, waitTime: float = 0.5) -> bool
Call IUIAutomationRangeValuePattern::SetValue.
Set the value of the control.
value: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-setvalue
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationrangevaluepattern

Readonly properties defined here:
IsReadOnly
Property IsReadOnly.
Call IUIAutomationRangeValuePattern::get_CurrentIsReadOnly.
Return bool, indicates whether the value of the element can be changed.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentisreadonly
LargeChange
Property LargeChange.
Call IUIAutomationRangeValuePattern::get_CurrentLargeChange.
Return float, the value that is added to or subtracted from the value of the control
              when a large change is made, such as when the PAGE DOWN key is pressed.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentlargechange
Maximum
Property Maximum.
Call IUIAutomationRangeValuePattern::get_CurrentMaximum.
Return float, the maximum value of the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentmaximum
Minimum
Property Minimum.
Call IUIAutomationRangeValuePattern::get_CurrentMinimum.
Return float, the minimum value of the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentminimum
SmallChange
Property SmallChange.
Call IUIAutomationRangeValuePattern::get_CurrentSmallChange.
Return float, the value that is added to or subtracted from the value of the control
              when a small change is made, such as when an arrow key is pressed.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentsmallchange
Value
Property Value.
Call IUIAutomationRangeValuePattern::get_CurrentValue.
Return float, the value of the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationrangevaluepattern-get_currentvalue

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class Rect(builtins.object)
    Rect(left: int = 0, top: int = 0, right: int = 0, bottom: int = 0)
 
class Rect, like `ctypes.wintypes.RECT`.
 
  Methods defined here:
__eq__(self, rect)
Return self==value.
__init__(self, left: int = 0, top: int = 0, right: int = 0, bottom: int = 0)
Initialize self.  See help(type(self)) for accurate signature.
__repr__(self) -> str
Return repr(self).
__str__(self) -> str
Return str(self).
contains(self, x: int, y: int) -> bool
height(self) -> int
intersect(self, rect: 'Rect') -> 'Rect'
isempty(self) -> int
offset(self, x: int, y: int) -> None
width(self) -> int
xcenter(self) -> int
ycenter(self) -> int

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
__hash__ = None

 
class RotateFlipType(builtins.object)
     Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Rotate180FlipNone = 2
Rotate180FlipX = 6
Rotate180FlipXY = 0
Rotate180FlipY = 4
Rotate270FlipNone = 3
Rotate270FlipX = 7
Rotate270FlipXY = 1
Rotate270FlipY = 5
Rotate90FlipNone = 1
Rotate90FlipX = 5
Rotate90FlipXY = 3
Rotate90FlipY = 7
RotateNoneFlipNone = 0
RotateNoneFlipX = 4
RotateNoneFlipXY = 2
RotateNoneFlipY = 6

 
class RowOrColumnMajor(builtins.object)
    RowOrColumnMajor from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-roworcolumnmajor
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ColumnMajor = 1
Indeterminate = 2
RowMajor = 0

 
class SW(builtins.object)
    ShowWindow params from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
ForceMinimize = 11
Hide = 0
Max = 11
Maximize = 3
Minimize = 6
Normal = 1
Restore = 9
Show = 5
ShowDefault = 10
ShowMaximized = 3
ShowMinNoActive = 7
ShowMinimized = 2
ShowNA = 8
ShowNoActivate = 4
ShowNormal = 1

 
class SWP(builtins.object)
    SetWindowPos params from Win32.
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
HWND_Bottom = 1
HWND_NoTopmost = -2
HWND_Top = 0
HWND_Topmost = -1
SWP_AsyncWindowPos = 16384
SWP_DeferErase = 8192
SWP_DrawFrame = 32
SWP_FrameChanged = 32
SWP_HideWindow = 128
SWP_NoActivate = 16
SWP_NoCopyBits = 256
SWP_NoMove = 2
SWP_NoOwnerZOrder = 512
SWP_NoRedraw = 8
SWP_NoReposition = 512
SWP_NoSendChanging = 1024
SWP_NoSize = 1
SWP_NoZOrder = 4
SWP_ShowWindow = 64

 
class ScrollAmount(builtins.object)
    ScrollAmount from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-scrollamount
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
LargeDecrement = 0
LargeIncrement = 3
NoAmount = 2
SmallDecrement = 1
SmallIncrement = 4

 
class ScrollBarControl(Control)
    ScrollBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ScrollBarControl
Control
builtins.object

Methods defined here:
GetRangeValuePattern(self) -> uiautomation.RangeValuePattern
Return `RangeValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ScrollItemPattern(builtins.object)
    ScrollItemPattern(pattern=None)
 

 
  Methods defined here:
ScrollIntoView(self, waitTime: float = 0.5) -> bool
Call IUIAutomationScrollItemPattern::ScrollIntoView.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollitempattern-scrollintoview
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationscrollitempattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ScrollPattern(builtins.object)
    ScrollPattern(pattern=None)
 

 
  Methods defined here:
Scroll(self, horizontalAmount: int, verticalAmount: int, waitTime: float = 0.5) -> bool
Call IUIAutomationScrollPattern::Scroll.
Scroll the visible region of the content area horizontally and vertically.
horizontalAmount: int, a value in ScrollAmount.
verticalAmount: int, a value in ScrollAmount.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-scroll
SetScrollPercent(self, horizontalPercent: float, verticalPercent: float, waitTime: float = 0.5) -> bool
Call IUIAutomationScrollPattern::SetScrollPercent.
Set the horizontal and vertical scroll positions as a percentage of the total content area within the UI Automation element.
horizontalPercent: float or int, a value in [0, 100] or ScrollPattern.NoScrollValue(-1) if no scroll.
verticalPercent: float or int, a value  in [0, 100] or ScrollPattern.NoScrollValue(-1) if no scroll.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-setscrollpercent
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationscrollpattern

Readonly properties defined here:
HorizontalScrollPercent
Property HorizontalScrollPercent.
Call IUIAutomationScrollPattern::get_CurrentHorizontalScrollPercent.
Return float, the horizontal scroll position.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currenthorizontalscrollpercent
HorizontalViewSize
Property HorizontalViewSize.
Call IUIAutomationScrollPattern::get_CurrentHorizontalViewSize.
Return float, the horizontal size of the viewable region of a scrollable element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currenthorizontalviewsize
HorizontallyScrollable
Property HorizontallyScrollable.
Call IUIAutomationScrollPattern::get_CurrentHorizontallyScrollable.
Return bool, indicates whether the element can scroll horizontally.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currenthorizontallyscrollable
VerticalScrollPercent
Property VerticalScrollPercent.
Call IUIAutomationScrollPattern::get_CurrentVerticalScrollPercent.
Return float, the vertical scroll position.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currentverticalscrollpercent
VerticalViewSize
Property VerticalViewSize.
Call IUIAutomationScrollPattern::get_CurrentVerticalViewSize.
Return float, the vertical size of the viewable region of a scrollable element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currentverticalviewsize
VerticallyScrollable
Property VerticallyScrollable.
Call IUIAutomationScrollPattern::get_CurrentVerticallyScrollable.
Return bool, indicates whether the element can scroll vertically.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currentverticallyscrollable

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
NoScrollValue = -1

 
class SelectionItemPattern(builtins.object)
    SelectionItemPattern(pattern=None)
 

 
  Methods defined here:
AddToSelection(self, waitTime: float = 0.5) -> bool
Call IUIAutomationSelectionItemPattern::AddToSelection.
Add the current element to the collection of selected items.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionitempattern-addtoselection
RemoveFromSelection(self, waitTime: float = 0.5) -> bool
Call IUIAutomationSelectionItemPattern::RemoveFromSelection.
Remove this element from the selection.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionitempattern-removefromselection
Select(self, waitTime: float = 0.5) -> bool
Call IUIAutomationSelectionItemPattern::Select.
Clear any selected items and then select the current element.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionitempattern-select
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationselectionitempattern

Readonly properties defined here:
IsSelected
Property IsSelected.
Call IUIAutomationScrollPattern::get_CurrentIsSelected.
Return bool, indicates whether this item is selected.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currentisselected
SelectionContainer
Property SelectionContainer.
Call IUIAutomationScrollPattern::get_CurrentSelectionContainer.
Return `Control` subclass, the element that supports IUIAutomationSelectionPattern and acts as the container for this item.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationscrollpattern-get_currentselectioncontainer

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class SelectionPattern(builtins.object)
    SelectionPattern(pattern=None)
 

 
  Methods defined here:
GetSelection(self) -> List[ForwardRef('Control')]
Call IUIAutomationSelectionPattern::GetCurrentSelection.
Return List[Control], a list of `Control` subclasses, the selected elements in the container..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionpattern-getcurrentselection
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationselectionpattern

Readonly properties defined here:
CanSelectMultiple
Property CanSelectMultiple.
Call IUIAutomationSelectionPattern::get_CurrentCanSelectMultiple.
Return bool, indicates whether more than one item in the container can be selected at one time.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionpattern-get_currentcanselectmultiple
IsSelectionRequired
Property IsSelectionRequired.
Call IUIAutomationSelectionPattern::get_CurrentIsSelectionRequired.
Return bool, indicates whether at least one item must be selected at all times.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionpattern-get_currentisselectionrequired

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class SemanticZoomControl(Control)
    SemanticZoomControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
SemanticZoomControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class SeparatorControl(Control)
    SeparatorControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
SeparatorControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class SliderControl(Control)
    SliderControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
SliderControl
Control
builtins.object

Methods defined here:
GetRangeValuePattern(self) -> uiautomation.RangeValuePattern
Return `RangeValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class SpinnerControl(Control)
    SpinnerControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
SpinnerControl
Control
builtins.object

Methods defined here:
GetRangeValuePattern(self) -> uiautomation.RangeValuePattern
Return `RangeValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetValuePattern(self) -> uiautomation.ValuePattern
Return `ValuePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class SplitButtonControl(Control)
    SplitButtonControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
SplitButtonControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Must support according to MSDN).
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class SpreadsheetItemPattern(builtins.object)
    SpreadsheetItemPattern(pattern=None)
 

 
  Methods defined here:
GetAnnotationObjects(self) -> List[ForwardRef('Control')]
Call IUIAutomationSelectionPattern::GetCurrentAnnotationObjects.
Return List[Control], a list of `Control` subclasses representing the annotations associated with this spreadsheet cell.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationspreadsheetitempattern-getcurrentannotationobjects
GetAnnotationTypes(self) -> List[int]
Call IUIAutomationSelectionPattern::GetCurrentAnnotationTypes.
Return List[int], a list of int values in class `AnnotationType`,
             indicating the types of annotations that are associated with this spreadsheet cell.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationselectionpattern-getcurrentannotationtypes
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationspreadsheetitempattern

Readonly properties defined here:
Formula
Property Formula.
Call IUIAutomationSpreadsheetItemPattern::get_CurrentFormula.
Return str, the formula for this cell.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationspreadsheetitempattern-get_currentformula

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class SpreadsheetPattern(builtins.object)
    SpreadsheetPattern(pattern=None)
 

 
  Methods defined here:
GetItemByName(self, name: str) -> 'Control'
Call IUIAutomationSpreadsheetPattern::GetItemByName.
name: str.
Return `Control` subclass or None, represents the spreadsheet cell that has the specified name..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationspreadsheetpattern-getitembyname
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationspreadsheetpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class StatusBarControl(Control)
    StatusBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
StatusBarControl
Control
builtins.object

Methods defined here:
GetGridPattern(self) -> uiautomation.GridPattern
Return `GridPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class StyleId(builtins.object)
    StyleId from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-style-identifiers
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
BulletedList = 70015
Custom = 70000
Emphasis = 70013
Heading1 = 70001
Heading2 = 70002
Heading3 = 70003
Heading4 = 70004
Heading5 = 70005
Heading6 = 70006
Heading7 = 70007
Heading8 = 70008
Heading9 = 70009
Normal = 70012
NumberedList = 70016
Quote = 70014
Subtitle = 70011
Title = 70010

 
class StylesPattern(builtins.object)
    StylesPattern(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationstylespattern

Readonly properties defined here:
ExtendedProperties
Property ExtendedProperties.
Call IUIAutomationStylesPattern::get_CurrentExtendedProperties.
Return str, a localized string that contains the list of extended properties for an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentextendedproperties
FillColor
Property FillColor.
Call IUIAutomationStylesPattern::get_CurrentFillColor.
Return int, the fill color of an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentfillcolor
FillPatternColor
Property FillPatternColor.
Call IUIAutomationStylesPattern::get_CurrentFillPatternColor.
Return int, the color of the pattern used to fill an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentfillpatterncolor
Shape
Property Shape.
Call IUIAutomationStylesPattern::get_CurrentShape.
Return str, the shape of an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentshape
StyleId
Property StyleId.
Call IUIAutomationStylesPattern::get_CurrentStyleId.
Return int, a value in class `StyleId`, the visual style associated with an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentstyleid
StyleName
Property StyleName.
Call IUIAutomationStylesPattern::get_CurrentStyleName.
Return str, the name of the visual style associated with an element in a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationstylespattern-get_currentstylename

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class SynchronizedInputPattern(builtins.object)
    SynchronizedInputPattern(pattern=None)
 

 
  Methods defined here:
Cancel(self) -> bool
Call IUIAutomationSynchronizedInputPattern::Cancel.
Cause the Microsoft UI Automation provider to stop listening for mouse or keyboard input.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationsynchronizedinputpattern-cancel
StartListening(self) -> bool
Call IUIAutomationSynchronizedInputPattern::StartListening.
Cause the Microsoft UI Automation provider to start listening for mouse or keyboard input.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationsynchronizedinputpattern-startlistening
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationsynchronizedinputpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TabControl(Control)
    TabControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TabControl
Control
builtins.object

Methods defined here:
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TabItemControl(Control)
    TabItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TabItemControl
Control
builtins.object

Methods defined here:
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TableControl(Control)
    TableControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TableControl
Control
builtins.object

Methods defined here:
GetGridItemPattern(self) -> uiautomation.GridItemPattern
Return `GridItemPattern` if it supports the pattern else None(Must support according to MSDN).
GetGridPattern(self) -> uiautomation.GridPattern
Return `GridPattern` if it supports the pattern else None(Must support according to MSDN).
GetTableItemPattern(self) -> uiautomation.TableItemPattern
Return `TableItemPattern` if it supports the pattern else None(Must support according to MSDN).
GetTableItemsValue(self, row: int = -1, column: int = -1)
Get the value of a table
row: int. Position of the row in the table
column: int. Position of the column in the table
Return a list with values in the table.
If a row and column is specified, return a cell value.
If only a row is specified, return a list with row values
GetTablePattern(self) -> uiautomation.TablePattern
Return `TablePattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TableItemPattern(builtins.object)
    TableItemPattern(pattern=None)
 

 
  Methods defined here:
GetColumnHeaderItems(self) -> List[ForwardRef('Control')]
Call IUIAutomationTableItemPattern::GetCurrentColumnHeaderItems.
Return List[Control], a list of `Control` subclasses, the column headers associated with a table item or cell.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtableitempattern-getcurrentcolumnheaderitems
GetRowHeaderItems(self) -> List[ForwardRef('Control')]
Call IUIAutomationTableItemPattern::GetCurrentRowHeaderItems.
Return List[Control], a list of `Control` subclasses, the row headers associated with a table item or cell.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtableitempattern-getcurrentrowheaderitems
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtableitempattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TablePattern(builtins.object)
    TablePattern(pattern=None)
 

 
  Methods defined here:
GetColumnHeaders(self) -> List[ForwardRef('Control')]
Call IUIAutomationTablePattern::GetCurrentColumnHeaders.
Return List[Control], a list of `Control` subclasses, representing all the column headers in a table..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtablepattern-getcurrentcolumnheaders
GetRowHeaders(self) -> List[ForwardRef('Control')]
Call IUIAutomationTablePattern::GetCurrentRowHeaders.
Return List[Control], a list of `Control` subclasses, representing all the row headers in a table.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtablepattern-getcurrentrowheaders
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtablepattern

Readonly properties defined here:
RowOrColumnMajor
Property RowOrColumnMajor.
Call IUIAutomationTablePattern::get_CurrentRowOrColumnMajor.
Return int, a value in class `RowOrColumnMajor`, the primary direction of traversal for the table.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtablepattern-get_currentroworcolumnmajor

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextAttributeId(builtins.object)
    TextAttributeId from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-textattribute-ids
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
AfterParagraphSpacingAttribute = 40042
AnimationStyleAttribute = 40000
AnnotationObjectsAttribute = 40032
AnnotationTypesAttribute = 40031
BackgroundColorAttribute = 40001
BeforeParagraphSpacingAttribute = 40041
BulletStyleAttribute = 40002
CapStyleAttribute = 40003
CaretBidiModeAttribute = 40039
CaretPositionAttribute = 40038
CultureAttribute = 40004
FontNameAttribute = 40005
FontSizeAttribute = 40006
FontWeightAttribute = 40007
ForegroundColorAttribute = 40008
HorizontalTextAlignmentAttribute = 40009
IndentationFirstLineAttribute = 40010
IndentationLeadingAttribute = 40011
IndentationTrailingAttribute = 40012
IsActiveAttribute = 40036
IsHiddenAttribute = 40013
IsItalicAttribute = 40014
IsReadOnlyAttribute = 40015
IsSubscriptAttribute = 40016
IsSuperscriptAttribute = 40017
LineSpacingAttribute = 40040
LinkAttribute = 40035
MarginBottomAttribute = 40018
MarginLeadingAttribute = 40019
MarginTopAttribute = 40020
MarginTrailingAttribute = 40021
OutlineStylesAttribute = 40022
OverlineColorAttribute = 40023
OverlineStyleAttribute = 40024
SayAsInterpretAsAttribute = 40043
SelectionActiveEndAttribute = 40037
StrikethroughColorAttribute = 40025
StrikethroughStyleAttribute = 40026
StyleIdAttribute = 40034
StyleNameAttribute = 40033
TabsAttribute = 40027
TextFlowDirectionsAttribute = 40028
UnderlineColorAttribute = 40029
UnderlineStyleAttribute = 40030

 
class TextChildPattern(builtins.object)
    TextChildPattern(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtextchildpattern

Readonly properties defined here:
TextContainer
Property TextContainer.
Call IUIAutomationSelectionContainer::get_TextContainer.
Return `Control` subclass, the nearest ancestor element that supports the Text control pattern.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextchildpattern-get_textcontainer
TextRange
Property TextRange.
Call IUIAutomationSelectionContainer::get_TextRange.
Return `TextRange`, a text range that encloses this child element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextchildpattern-get_textrange

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextControl(Control)
    TextControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TextControl
Control
builtins.object

Methods defined here:
GetGridItemPattern(self) -> uiautomation.GridItemPattern
Return `GridItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTableItemPattern(self) -> uiautomation.TableItemPattern
Return `TableItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTextPattern(self) -> uiautomation.TextPattern
Return `TextPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TextEditPattern(builtins.object)
    TextEditPattern(pattern=None)
 

 
  Methods defined here:
GetActiveComposition(self) -> Optional[uiautomation.TextRange]
Call IUIAutomationTextEditPattern::GetActiveComposition.
Return `TextRange` or None, the active composition.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtexteditpattern-getactivecomposition
GetConversionTarget(self) -> Optional[uiautomation.TextRange]
Call IUIAutomationTextEditPattern::GetConversionTarget.
Return `TextRange` or None, the current conversion target range..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtexteditpattern-getconversiontarget
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtexteditpattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextPattern(builtins.object)
    TextPattern(pattern=None)
 

 
  Methods defined here:
GetSelection(self) -> List[uiautomation.TextRange]
Call IUIAutomationTextPattern::GetSelection.
Return List[TextRange], a list of `TextRange`, represents the currently selected text in a text-based control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-getselection
GetVisibleRanges(self) -> List[uiautomation.TextRange]
Call IUIAutomationTextPattern::GetVisibleRanges.
Return List[TextRange], a list of `TextRange`, disjoint text ranges from a text-based control
             where each text range represents a contiguous span of visible text.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-getvisibleranges
RangeFromChild(self, child) -> Optional[uiautomation.TextRange]
Call IUIAutomationTextPattern::RangeFromChild.
child: `Control` or its subclass.
Return `TextRange` or None, a text range enclosing a child element such as an image,
    hyperlink, Microsoft Excel spreadsheet, or other embedded object.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-rangefromchild
RangeFromPoint(self, x: int, y: int) -> Optional[uiautomation.TextRange]
Call IUIAutomationTextPattern::RangeFromPoint.
child: `Control` or its subclass.
Return `TextRange` or None, the degenerate (empty) text range nearest to the specified screen coordinates.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-rangefrompoint
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtextpattern

Readonly properties defined here:
DocumentRange
Property DocumentRange.
Call IUIAutomationTextPattern::get_DocumentRange.
Return `TextRange`, a text range that encloses the main text of a document.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-get_documentrange
SupportedTextSelection
Property SupportedTextSelection.
Call IUIAutomationTextPattern::get_SupportedTextSelection.
Return bool, specifies the type of text selection that is supported by the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextpattern-get_supportedtextselection

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextPattern2(builtins.object)
    TextPattern2(pattern=None)
 

 
  Methods defined here:
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtextpattern2

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextPatternRangeEndpoint(builtins.object)
    TextPatternRangeEndpoint from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-textpatternrangeendpoint
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
End = 1
Start = 0

 
class TextRange(builtins.object)
    TextRange(textRange=None)
 

 
  Methods defined here:
AddToSelection(self, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::AddToSelection.
Add the text range to the collection of selected text ranges in a control that supports multiple, disjoint spans of selected text.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-addtoselection
Clone(self) -> 'TextRange'
Call IUIAutomationTextRange::Clone.
return `TextRange`, identical to the original and inheriting all properties of the original.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-clone
Compare(self, textRange: 'TextRange') -> bool
Call IUIAutomationTextRange::Compare.
textRange: `TextRange`.
Return bool, specifies whether this text range has the same endpoints as another text range.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-compare
CompareEndpoints(self, srcEndPoint: int, textRange: 'TextRange', targetEndPoint: int) -> int
Call IUIAutomationTextRange::CompareEndpoints.
srcEndPoint: int, a value in class `TextPatternRangeEndpoint`.
textRange: `TextRange`.
targetEndPoint: int, a value in class `TextPatternRangeEndpoint`.
Return int, a negative value if the caller's endpoint occurs earlier in the text than the target endpoint;
            0 if the caller's endpoint is at the same location as the target endpoint;
            or a positive value if the caller's endpoint occurs later in the text than the target endpoint.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-compareendpoints
ExpandToEnclosingUnit(self, unit: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::ExpandToEnclosingUnit.
Normalize the text range by the specified text unit.
    The range is expanded if it is smaller than the specified unit,
    or shortened if it is longer than the specified unit.
unit: int, a value in class `TextUnit`.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-expandtoenclosingunit
FindAttribute(self, textAttributeId: int, val, backward: bool) -> Optional[ForwardRef('TextRange')]
Call IUIAutomationTextRange::FindAttribute.
textAttributeID: int, a value in class `TextAttributeId`.
val: COM VARIANT according to textAttributeId? todo.
backward: bool, True if the last occurring text range should be returned instead of the first; otherwise False.
return `TextRange` or None, a text range subset that has the specified text attribute value.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-findattribute
FindText(self, text: str, backward: bool, ignoreCase: bool) -> Optional[ForwardRef('TextRange')]
Call IUIAutomationTextRange::FindText.
text: str,
backward: bool, True if the last occurring text range should be returned instead of the first; otherwise False.
ignoreCase: bool, True if case should be ignored; otherwise False.
return `TextRange` or None, a text range subset that contains the specified text.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-findtext
GetAttributeValue(self, textAttributeId: int) -> comtypes.POINTER(IUnknown)
Call IUIAutomationTextRange::GetAttributeValue.
textAttributeId: int, a value in class `TextAttributeId`.
Return `ctypes.POINTER(comtypes.IUnknown)` or None, the value of the specified text attribute across the entire text range, todo.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-getattributevalue
GetBoundingRectangles(self) -> List[uiautomation.Rect]
Call IUIAutomationTextRange::GetBoundingRectangles.
textAttributeId: int, a value in class `TextAttributeId`.
Return List[Rect], a list of `Rect`.
    bounding rectangles for each fully or partially visible line of text in a text range..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-getboundingrectangles
 
for rect in textRange.GetBoundingRectangles():
    print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
GetChildren(self) -> List[ForwardRef('Control')]
Call IUIAutomationTextRange::GetChildren.
textAttributeId: int, a value in class `TextAttributeId`.
Return List[Control], a list of `Control` subclasses, embedded objects that fall within the text range..
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-getchildren
GetEnclosingControl(self) -> 'Control'
Call IUIAutomationTextRange::GetEnclosingElement.
Return `Control` subclass, the innermost UI Automation element that encloses the text range.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-getenclosingelement
GetText(self, maxLength: int = -1) -> str
Call IUIAutomationTextRange::GetText.
maxLength: int, the maximum length of the string to return, or -1 if no limit is required.
Return str, the plain text of the text range.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-gettext
Move(self, unit: int, count: int, waitTime: float = 0.5) -> int
Call IUIAutomationTextRange::Move.
Move the text range forward or backward by the specified number of text units.
unit: int, a value in class `TextUnit`.
count: int, the number of text units to move.
       A positive value moves the text range forward.
       A negative value moves the text range backward. Zero has no effect.
waitTime: float.
Return: int, the number of text units actually moved.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-move
MoveEndpointByRange(self, srcEndPoint: int, textRange: 'TextRange', targetEndPoint: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::MoveEndpointByRange.
Move one endpoint of the current text range to the specified endpoint of a second text range.
srcEndPoint: int, a value in class `TextPatternRangeEndpoint`.
textRange: `TextRange`.
targetEndPoint: int, a value in class `TextPatternRangeEndpoint`.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-moveendpointbyrange
MoveEndpointByUnit(self, endPoint: int, unit: int, count: int, waitTime: float = 0.5) -> int
Call IUIAutomationTextRange::MoveEndpointByUnit.
Move one endpoint of the text range the specified number of text units within the document range.
endPoint: int, a value in class `TextPatternRangeEndpoint`.
unit: int, a value in class `TextUnit`.
count: int, the number of units to move.
            A positive count moves the endpoint forward.
            A negative count moves backward.
            A count of 0 has no effect.
waitTime: float.
Return int, the count of units actually moved.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-moveendpointbyunit
RemoveFromSelection(self, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::RemoveFromSelection.
Remove the text range from an existing collection of selected text in a text container that supports multiple, disjoint selections.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-removefromselection
ScrollIntoView(self, alignTop: bool = True, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::ScrollIntoView.
Cause the text control to scroll until the text range is visible in the viewport.
alignTop: bool, True if the text control should be scrolled so that the text range is flush with the top of the viewport;
                False if it should be flush with the bottom of the viewport.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-scrollintoview
Select(self, waitTime: float = 0.5) -> bool
Call IUIAutomationTextRange::Select.
Select the span of text that corresponds to this text range, and remove any previous selection.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtextrange-select
__init__(self, textRange=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtextrange

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TextUnit(builtins.object)
    TextUnit from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-textunit
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Character = 0
Document = 6
Format = 1
Line = 3
Page = 5
Paragraph = 4
Word = 2

 
class ThumbControl(Control)
    ThumbControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ThumbControl
Control
builtins.object

Methods defined here:
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Must support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TitleBarControl(Control)
    TitleBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TitleBarControl
Control
builtins.object

Methods defined here:
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TogglePattern(builtins.object)
    TogglePattern(pattern=None)
 

 
  Methods defined here:
Toggle(self, waitTime: float = 0.5) -> bool
Call IUIAutomationTogglePattern::Toggle.
Cycle through the toggle states of the control.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtogglepattern-toggle
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtogglepattern

Readonly properties defined here:
ToggleState
Property ToggleState.
Call IUIAutomationTogglePattern::get_CurrentToggleState.
Return int, a value in class `ToggleState`, the state of the control.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtogglepattern-get_currenttogglestate

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ToggleState(builtins.object)
    ToggleState from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-togglestate
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Indeterminate = 2
Off = 0
On = 1

 
class ToolBarControl(Control)
    ToolBarControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ToolBarControl
Control
builtins.object

Methods defined here:
GetDockPattern(self) -> uiautomation.DockPattern
Return `DockPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class ToolTipControl(Control)
    ToolTipControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
ToolTipControl
Control
builtins.object

Methods defined here:
GetTextPattern(self) -> uiautomation.TextPattern
Return `TextPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetWindowPattern(self) -> uiautomation.WindowPattern
Return `WindowPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TopLevel(builtins.object)
    Class TopLevel
 
  Methods defined here:
IsMaximize(self) -> bool
IsMinimize(self) -> bool
IsTopmost(self) -> bool
Maximize(self, waitTime: float = 0.5) -> bool
Set top level window maximize.
Minimize(self, waitTime: float = 0.5) -> bool
MoveToCenter(self) -> bool
Move window to screen center.
Restore(self, waitTime: float = 0.5) -> bool
Restore window to normal state.
Similar to SwitchToThisWindow.
SetActive(self, waitTime: float = 0.5) -> bool
Set top level window active.
SetTopmost(self, isTopmost: bool = True, waitTime: float = 0.5) -> bool
Set top level window topmost.
isTopmost: bool.
waitTime: float.
SwitchToThisWindow(self, waitTime: float = 0.5) -> None

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TransformPattern(builtins.object)
    TransformPattern(pattern=None)
 

 
  Methods defined here:
Move(self, x: int, y: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern::Move.
Move the UI Automation element.
x: int.
y: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-move
Resize(self, width: int, height: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern::Resize.
Resize the UI Automation element.
width: int.
height: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-resize
Rotate(self, degrees: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern::Rotate.
Rotates the UI Automation element.
degrees: int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-rotate
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtransformpattern

Readonly properties defined here:
CanMove
Property CanMove.
Call IUIAutomationTransformPattern::get_CurrentCanMove.
Return bool, indicates whether the element can be moved.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-get_currentcanmove
CanResize
Property CanResize.
Call IUIAutomationTransformPattern::get_CurrentCanResize.
Return bool, indicates whether the element can be resized.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-get_currentcanresize
CanRotate
Property CanRotate.
Call IUIAutomationTransformPattern::get_CurrentCanRotate.
Return bool, indicates whether the element can be rotated.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern-get_currentcanrotate

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TransformPattern2(builtins.object)
    TransformPattern2(pattern=None)
 

 
  Methods defined here:
Zoom(self, zoomLevel: float, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern2::Zoom.
Zoom the viewport of the control.
zoomLevel: float for int.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-zoom
ZoomByUnit(self, zoomUnit: int, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern2::ZoomByUnit.
Zoom the viewport of the control by the specified unit.
zoomUnit: int, a value in class `ZoomUnit`.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-zoombyunit
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationtransformpattern2

Readonly properties defined here:
CanZoom
Property CanZoom.
Call IUIAutomationTransformPattern2::get_CurrentCanZoom.
Return bool, indicates whether the control supports zooming of its viewport.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-get_CurrentCanZoom
ZoomLevel
Property ZoomLevel.
Call IUIAutomationTransformPattern2::get_CurrentZoomLevel.
Return float, the zoom level of the control's viewport.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-get_currentzoomlevel
ZoomMaximum
Property ZoomMaximum.
Call IUIAutomationTransformPattern2::get_CurrentZoomMaximum.
Return float, the maximum zoom level of the control's viewport.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-get_currentzoommaximum
ZoomMinimum
Property ZoomMinimum.
Call IUIAutomationTransformPattern2::get_CurrentZoomMinimum.
Return float, the minimum zoom level of the control's viewport.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationtransformpattern2-get_currentzoomminimum

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class TreeControl(Control)
    TreeControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TreeControl
Control
builtins.object

Methods defined here:
GetScrollPattern(self) -> uiautomation.ScrollPattern
Return `ScrollPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionPattern(self) -> uiautomation.SelectionPattern
Return `SelectionPattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class TreeItemControl(Control)
    TreeItemControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
TreeItemControl
Control
builtins.object

Methods defined here:
GetExpandCollapsePattern(self) -> uiautomation.ExpandCollapsePattern
Return `ExpandCollapsePattern` if it supports the pattern else None(Must support according to MSDN).
GetInvokePattern(self) -> uiautomation.InvokePattern
Return `InvokePattern` if it supports the pattern else None(Conditional support according to MSDN).
GetScrollItemPattern(self) -> uiautomation.ScrollItemPattern
Return `ScrollItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetSelectionItemPattern(self) -> uiautomation.SelectionItemPattern
Return `SelectionItemPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTogglePattern(self) -> uiautomation.TogglePattern
Return `TogglePattern` if it supports the pattern else None(Conditional support according to MSDN).
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

 
class UIAutomationInitializerInThread(builtins.object)
    UIAutomationInitializerInThread(debug: bool = False)
 

 
  Methods defined here:
Uninitialize(self)
__del__(self)
__enter__(self)
__exit__(self, exceptionType, exceptionValue, exceptionTraceback)
__init__(self, debug: bool = False)
Initialize self.  See help(type(self)) for accurate signature.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class ValuePattern(builtins.object)
    ValuePattern(pattern=None)
 

 
  Methods defined here:
SetValue(self, value: str, waitTime: float = 0.5) -> bool
Call IUIAutomationTransformPattern2::IUIAutomationValuePattern::SetValue.
Set the value of the element.
value: str.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationvaluepattern-setvalue
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationvaluepattern

Readonly properties defined here:
IsReadOnly
Property IsReadOnly.
Call IUIAutomationTransformPattern2::IUIAutomationValuePattern::get_CurrentIsReadOnly.
Return bool, indicates whether the value of the element is read-only.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationvaluepattern-get_currentisreadonly
Value
Property Value.
Call IUIAutomationTransformPattern2::IUIAutomationValuePattern::get_CurrentValue.
Return str, the value of the element.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationvaluepattern-get_currentvalue

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class VirtualizedItemPattern(builtins.object)
    VirtualizedItemPattern(pattern=None)
 

 
  Methods defined here:
Realize(self, waitTime: float = 0.5) -> bool
Call IUIAutomationVirtualizedItemPattern::Realize.
Create a full UI Automation element for a virtualized item.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationvirtualizeditempattern-realize
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationvirtualizeditempattern

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class WindowControl(Control, TopLevel)
    WindowControl(searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
 

 
 
Method resolution order:
WindowControl
Control
TopLevel
builtins.object

Methods defined here:
GetDockPattern(self) -> uiautomation.DockPattern
Return `DockPattern` if it supports the pattern else None(Conditional support according to MSDN).
GetTransformPattern(self) -> uiautomation.TransformPattern
Return `TransformPattern` if it supports the pattern else None(Must support according to MSDN).
GetWindowPattern(self) -> uiautomation.WindowPattern
Return `WindowPattern` if it supports the pattern else None(Must support according to MSDN).
MetroClose(self, waitTime: float = 0.5) -> None
Only work on Windows 8/8.1, if current window is Metro UI.
waitTime: float.
__init__(self, searchFromControl: Optional[uiautomation.Control] = None, searchDepth: int = 4294967295, searchInterval: float = 0.5, foundIndex: int = 1, element=None, **searchProperties)
searchFromControl: `Control` or its subclass, if it is None, search from root control(Desktop).
searchDepth: int, max search depth from searchFromControl.
foundIndex: int, starts with 1, >= 1.
searchInterval: float, wait searchInterval after every search in self.Refind and self.Exists, the global timeout is TIME_OUT_SECOND.
element: `ctypes.POINTER(IUIAutomationElement)`, internal use only.
searchProperties: defines how to search, the following keys can be used:
                    ControlType: int, a value in class `ControlType`.
                    ClassName: str.
                    AutomationId: str.
                    Name: str.
                    SubName: str, a part str in Name.
                    RegexName: str, supports regex using re.match.
                        You can only use one of Name, SubName, RegexName in searchProperties.
                    Depth: int, only search controls in relative depth from searchFromControl, ignore controls in depth(0~Depth-1),
                        if set, searchDepth will be set to Depth too.
                    Compare: Callable[[Control, int], bool], custom compare function(control: Control, depth: int) -> bool.
 
`Control` wraps IUIAutomationElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationelement

Methods inherited from Control:
AddSearchProperties(self, **searchProperties) -> None
Add search properties using `dict.update`.
searchProperties: dict, same as searchProperties in `Control.__init__`.
ButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ButtonControl'
CalendarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CalendarControl'
CaptureToImage(self, savePath: str, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> bool
Capture control to a image file.
savePath: str, should end with .bmp, .jpg, .jpeg, .png, .gif, .tif, .tiff.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
Return bool, True if succeed otherwise False.
CheckBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CheckBoxControl'
Click(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
Click(), Click(ratioX=0.5, ratioY=0.5): click center.
Click(10, 10): click left+10, top+10.
Click(-10, -10): click right-10, bottom-10.
ComboBoxControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ComboBoxControl'
Control(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'Control'
CustomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'CustomControl'
DataGridControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataGridControl'
DataItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DataItemControl'
Disappears(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotDisappear: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Check if control disappears every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if control disappears.
DocumentControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'DocumentControl'
DoubleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
DoubleClick(), DoubleClick(ratioX=0.5, ratioY=0.5): double click center.
DoubleClick(10, 10): double click left+10, top+10.
DoubleClick(-10, -10): double click right-10, bottom-10.
DragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
EditControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'EditControl'
Exists(self, maxSearchSeconds: float = 5, searchIntervalSeconds: float = 0.5, printIfNotExist: bool = False) -> bool
maxSearchSeconds: float
searchIntervalSeconds: float
Find control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
Return bool, True if find
GetAncestorControl(self, condition: Callable[[ForwardRef('Control'), int], bool]) -> Optional[ForwardRef('Control')]
Get an ancestor control that matches the condition.
condition: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool,
           depth starts with -1 and decreses when search goes up.
Return `Control` subclass or None.
GetCachedPattern(self, patternId: int, cache: bool)
Get a pattern by patternId.
patternId: int, a value in class `PatternId`.
Return a pattern if it supports the pattern else None.
cache: bool, if True, store the pattern for later use, if False, get a new pattern by `self.GetPattern`.
GetChildren(self) -> List[ForwardRef('Control')]
Return List[Control], a list of `Control` subclasses.
GetClickablePoint(self) -> Tuple[int, int, bool]
Call IUIAutomationElement::GetClickablePoint.
Return Tuple[int, int, bool], three items tuple (x, y, gotClickable), such as (20, 10, True)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getclickablepoint
GetColorfulSearchPropertiesStr(self, keyColor='DarkGreen', valueColor='DarkCyan') -> str
keyColor, valueColor: str, color name in class ConsoleColor
GetFirstChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLastChildControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetLegacyIAccessiblePattern(self) -> uiautomation.LegacyIAccessiblePattern
Return `LegacyIAccessiblePattern` if it supports the pattern else None.
GetNextSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetParentControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPattern(self, patternId: int)
Call IUIAutomationElement::GetCurrentPattern.
Get a new pattern by pattern id if it supports the pattern.
patternId: int, a value in class `PatternId`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpattern
GetPatternAs(self, patternId: int, riid)
Call IUIAutomationElement::GetCurrentPatternAs.
Get a new pattern by pattern id if it supports the pattern, todo.
patternId: int, a value in class `PatternId`.
riid: GUID.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpatternas
GetPixelColor(self, x: int, y: int) -> Optional[int]
Call native `GetPixelColor` if control has a valid native handle.
Use `self.ToBitmap` if control doesn't have a valid native handle or you get many pixels.
x: int, internal x position.
y: int, internal y position.
Return int, a color value in bgr.
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
GetPosition(self, ratioX: float = 0.5, ratioY: float = 0.5) -> Optional[Tuple[int, int]]
Gets the position of the center of the control.
ratioX: float.
ratioY: float.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
GetPreviousSiblingControl(self) -> Optional[ForwardRef('Control')]
Return `Control` subclass or None.
GetPropertyValue(self, propertyId: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValue.
propertyId: int, a value in class `PropertyId`.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalue
GetPropertyValueEx(self, propertyId: int, ignoreDefaultValue: int) -> Any
Call IUIAutomationElement::GetCurrentPropertyValueEx.
propertyId: int, a value in class `PropertyId`.
ignoreDefaultValue: int, 0 or 1.
Return Any, corresponding type according to propertyId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getcurrentpropertyvalueex
GetRuntimeId(self) -> List[int]
Call IUIAutomationElement::GetRuntimeId.
Return List[int], a list of int.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-getruntimeid
GetSearchPropertiesStr(self) -> str
GetSiblingControl(self, condition: Callable[[ForwardRef('Control')], bool], forward: bool = True) -> Optional[ForwardRef('Control')]
Get a sibling control that matches the condition.
forward: bool, if True, only search next siblings, if False, search pervious siblings first, then search next siblings.
condition: Callable[[Control], bool], function(control: Control) -> bool.
Return `Control` subclass or None.
GetTopLevelControl(self) -> Optional[ForwardRef('Control')]
Get the top level control which current control lays.
If current control is top level, return self.
If current control is root control, return None.
Return `PaneControl` or `WindowControl` or None.
GetWindowText(self) -> Optional[str]
Call native GetWindowText if control has a valid native handle.
GroupControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'GroupControl'
HeaderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderControl'
HeaderItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HeaderItemControl'
Hide(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Hide)`.
waitTime: float
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
HyperlinkControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'HyperlinkControl'
ImageControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ImageControl'
IsTopLevel(self) -> bool
Determine whether current control is top level.
ListControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListControl'
ListItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ListItemControl'
MenuBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuBarControl'
MenuControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuControl'
MenuItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'MenuItemControl'
MiddleClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, middle click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, middle click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
MiddleClick(), MiddleClick(ratioX=0.5, ratioY=0.5): middle click center.
MiddleClick(10, 10): middle click left+10, top+10.
MiddleClick(-10, -10): middle click right-10, bottom-10.
MoveCursorToInnerPos(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's internal position, default to center.
x: int, if < 0, move to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0)
    after moving or None if control's width or height is 0.
MoveCursorToMyCenter(self, simulateMove: bool = True) -> Optional[Tuple[int, int]]
Move cursor to control's center.
Return Tuple[int, int], two ints tuple (x, y), the cursor positon relative to screen(0, 0) after moving.
MoveWindow(self, x: int, y: int, width: int, height: int, repaint: bool = True) -> bool
Call native MoveWindow if control has a valid native handle.
x: int.
y: int.
width: int.
height: int.
repaint: bool.
Return bool, True if succeed otherwise False.
PaneControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'PaneControl'
ProgressBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ProgressBarControl'
RadioButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'RadioButtonControl'
Refind(self, maxSearchSeconds: float = 10, searchIntervalSeconds: float = 0.5, raiseException: bool = True) -> bool
Refind the control every searchIntervalSeconds seconds in maxSearchSeconds seconds.
maxSearchSeconds: float.
searchIntervalSeconds: float.
raiseException: bool, if True, raise a LookupError if timeout.
Return bool, True if find.
RemoveSearchProperties(self, **searchProperties) -> None
searchProperties: dict, same as searchProperties in `Control.__init__`.
RightClick(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, simulateMove: bool = True, waitTime: float = 0.5) -> None
x: int, if < 0, right click self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, right click self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
simulateMove: bool, if True, first move cursor to control smoothly.
waitTime: float.
 
RightClick(), RightClick(ratioX=0.5, ratioY=0.5): right click center.
RightClick(10, 10): right click left+10, top+10.
RightClick(-10, -10): right click right-10, bottom-10.
RightDragDrop(self, x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
ScrollBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ScrollBarControl'
SemanticZoomControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SemanticZoomControl'
SendKey(self, key: int, waitTime: float = 0.5) -> None
Make control have focus first and type a key.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
key: int, a key code value in class Keys.
waitTime: float.
SendKeys(self, text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True) -> None
Make control have focus first and type keys.
`self.SetFocus` may not work for some controls, you may need to click it to make it have focus.
text: str, keys to type, see the docstring of `SendKeys`.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typied is depend on the input method if a input method is on.
SeparatorControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SeparatorControl'
SetFocus(self) -> bool
Call IUIAutomationElement::SetFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-setfocus
SetSearchDepth(self, searchDepth: int) -> None
SetSearchFromControl(self, searchFromControl: 'Control') -> None
searchFromControl: `Control` or its subclass
SetWindowText(self, text: str) -> bool
Call native SetWindowText if control has a valid native handle.
Show(self, waitTime: float = 0.5) -> Optional[bool]
Call native `ShowWindow(SW.Show)`.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
ShowWindow(self, cmdShow: int, waitTime: float = 0.5) -> Optional[bool]
Get a native handle from self or ancestors until valid and call native `ShowWindow` with cmdShow.
cmdShow: int, a value in in class `SW`.
waitTime: float.
Return bool, True if succeed otherwise False and None if the handle could not be gotten.
SliderControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SliderControl'
SpinnerControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SpinnerControl'
SplitButtonControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'SplitButtonControl'
StatusBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'StatusBarControl'
TabControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabControl'
TabItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TabItemControl'
TableControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TableControl'
TextControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TextControl'
ThumbControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ThumbControl'
TitleBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TitleBarControl'
ToBitmap(self, x: int = 0, y: int = 0, width: int = 0, height: int = 0) -> Optional[uiautomation.Bitmap]
Capture control to a `Bitmapobject.
x, y: int, the point in control's internal position(from 0,0).
width, height: int, image's width and height from x, y, use 0 for entire area.
               If width(or height) < 0, image size will be control's width(or height) - width(or height).
ToolBarControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolBarControl'
ToolTipControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'ToolTipControl'
TreeControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeControl'
TreeItemControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'TreeItemControl'
WheelDown(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel down.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(self, x: Optional[int] = None, y: Optional[int] = None, ratioX: float = 0.5, ratioY: float = 0.5, wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Make control have focus first, move cursor to the specified position and mouse wheel up.
x: int, if < 0, move x cursor to self.BoundingRectangle.right + x, if not None, ignore ratioX.
y: int, if < 0, move y cursor to self.BoundingRectangle.bottom + y, if not None, ignore ratioY.
ratioX: float.
ratioY: float.
wheelTimes: int.
interval: float.
waitTime: float.
WindowControl(self, searchDepth=4294967295, searchInterval=0.5, foundIndex=1, element=0, **searchProperties) -> 'WindowControl'
__getitem__(self, pos: int) -> Optional[ForwardRef('Control')]
__str__(self) -> str
Return str(self).

Static methods inherited from Control:
CreateControlFromControl(control: 'Control') -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a control instance, copy it.
control: `Control` or its subclass.
Return a subclass of `Control`, an instance of the control's real type.
For example: if control's ControlType is EditControl, return an EditControl.
CreateControlFromElement(element) -> Optional[ForwardRef('Control')]
Create a concreate `Control` from a com type `IUIAutomationElement`.
element: `ctypes.POINTER(IUIAutomationElement)`.
Return a subclass of `Control`, an instance of the control's real type.

Readonly properties inherited from Control:
AcceleratorKey
Property AcceleratorKey.
Call IUIAutomationElement::get_CurrentAcceleratorKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentacceleratorkey
AccessKey
Property AccessKey.
Call IUIAutomationElement::get_CurrentAccessKey.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentaccesskey
AriaProperties
Property AriaProperties.
Call IUIAutomationElement::get_CurrentAriaProperties.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariaproperties
AriaRole
Property AriaRole.
Call IUIAutomationElement::get_CurrentAriaRole.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentariarole
AutomationId
Property AutomationId.
Call IUIAutomationElement::get_CurrentAutomationId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentautomationid
BoundingRectangle
Property BoundingRectangle.
Call IUIAutomationElement::get_CurrentBoundingRectangle.
Return `Rect`.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentboundingrectangle
 
rect = control.BoundingRectangle
print(rect.left, rect.top, rect.right, rect.bottom, rect.width(), rect.height(), rect.xcenter(), rect.ycenter())
ClassName
Property ClassName.
Call IUIAutomationElement::get_CurrentClassName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentclassname
ControlType
Property ControlType.
Return int, a value in class `ControlType`.
Call IUIAutomationElement::get_CurrentControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentcontroltype
ControlTypeName
Property ControlTypeName.
Culture
Property Culture.
Call IUIAutomationElement::get_CurrentCulture.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentculture
Element
Property Element.
Return `ctypes.POINTER(IUIAutomationElement)`.
FrameworkId
Property FrameworkId.
Call IUIAutomationElement::get_CurrentFrameworkId.
Return str, such as Win32, WPF...
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentframeworkid
HasKeyboardFocus
Property HasKeyboardFocus.
Call IUIAutomationElement::get_CurrentHasKeyboardFocus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthaskeyboardfocus
HelpText
Property HelpText.
Call IUIAutomationElement::get_CurrentHelpText.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currenthelptext
IsContentElement
Property IsContentElement.
Call IUIAutomationElement::get_CurrentIsContentElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontentelement
IsControlElement
Property IsControlElement.
Call IUIAutomationElement::get_CurrentIsControlElement.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiscontrolelement
IsDataValidForForm
Property IsDataValidForForm.
Call IUIAutomationElement::get_CurrentIsDataValidForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisdatavalidforform
IsEnabled
Property IsEnabled.
Call IUIAutomationElement::get_CurrentIsEnabled.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisenabled
IsKeyboardFocusable
Property IsKeyboardFocusable.
Call IUIAutomationElement::get_CurrentIsKeyboardFocusable.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentiskeyboardfocusable
IsOffscreen
Property IsOffscreen.
Call IUIAutomationElement::get_CurrentIsOffscreen.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisoffscreen
IsPassword
Property IsPassword.
Call IUIAutomationElement::get_CurrentIsPassword.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentispassword
IsRequiredForForm
Property IsRequiredForForm.
Call IUIAutomationElement::get_CurrentIsRequiredForForm.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentisrequiredforform
ItemStatus
Property ItemStatus.
Call IUIAutomationElement::get_CurrentItemStatus.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemstatus
ItemType
Property ItemType.
Call IUIAutomationElement::get_CurrentItemType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentitemtype
LocalizedControlType
Property LocalizedControlType.
Call IUIAutomationElement::get_CurrentLocalizedControlType.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentlocalizedcontroltype
Name
Property Name.
Call IUIAutomationElement::get_CurrentName.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentname
NativeWindowHandle
Property NativeWindowHandle.
Call IUIAutomationElement::get_CurrentNativeWindowHandle.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentnativewindowhandle
Orientation
Property Orientation.
Return int, a value in class `OrientationType`.
Call IUIAutomationElement::get_CurrentOrientation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentorientation
ProcessId
Property ProcessId.
Call IUIAutomationElement::get_CurrentProcessId.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentprocessid
ProviderDescription
Property ProviderDescription.
Call IUIAutomationElement::get_CurrentProviderDescription.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationelement-get_currentproviderdescription

Data descriptors inherited from Control:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from Control:
ValidKeys = {'AutomationId', 'ClassName', 'Compare', 'ControlType', 'Depth', 'Name', ...}

Methods inherited from TopLevel:
IsMaximize(self) -> bool
IsMinimize(self) -> bool
IsTopmost(self) -> bool
Maximize(self, waitTime: float = 0.5) -> bool
Set top level window maximize.
Minimize(self, waitTime: float = 0.5) -> bool
MoveToCenter(self) -> bool
Move window to screen center.
Restore(self, waitTime: float = 0.5) -> bool
Restore window to normal state.
Similar to SwitchToThisWindow.
SetActive(self, waitTime: float = 0.5) -> bool
Set top level window active.
SetTopmost(self, isTopmost: bool = True, waitTime: float = 0.5) -> bool
Set top level window topmost.
isTopmost: bool.
waitTime: float.
SwitchToThisWindow(self, waitTime: float = 0.5) -> None

 
class WindowInteractionState(builtins.object)
    WindowInteractionState from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-windowinteractionstate
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
BlockedByModalWindow = 3
Closing = 1
NotResponding = 4
ReadyForUserInteraction = 2
Running = 0

 
class WindowPattern(builtins.object)
    WindowPattern(pattern=None)
 

 
  Methods defined here:
Close(self, waitTime: float = 0.5) -> bool
Call IUIAutomationWindowPattern::Close.
Close the window.
waitTime: float.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-close
SetWindowVisualState(self, state: int, waitTime: float = 0.5) -> bool
Call IUIAutomationWindowPattern::SetWindowVisualState.
Minimize, maximize, or restore the window.
state: int, a value in class `WindowVisualState`.
waitTime: float.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-setwindowvisualstate
WaitForInputIdle(self, milliseconds: int) -> bool
Call IUIAutomationWindowPattern::WaitForInputIdle.
Cause the calling code to block for the specified time or
    until the associated process enters an idle state, whichever completes first.
milliseconds: int.
Return bool, True if succeed otherwise False.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-waitforinputidle
__init__(self, pattern=None)
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nn-uiautomationclient-iuiautomationwindowpattern

Readonly properties defined here:
CanMaximize
Property CanMaximize.
Call IUIAutomationWindowPattern::get_CurrentCanMaximize.
Return bool, indicates whether the window can be maximized.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentcanmaximize
CanMinimize
Property CanMinimize.
Call IUIAutomationWindowPattern::get_CurrentCanMinimize.
Return bool, indicates whether the window can be minimized.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentcanminimize
IsModal
Property IsModal.
Call IUIAutomationWindowPattern::get_CurrentIsModal.
Return bool, indicates whether the window is modal.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentismodal
IsTopmost
Property IsTopmost.
Call IUIAutomationWindowPattern::get_CurrentIsTopmost.
Return bool, indicates whether the window is the topmost element in the z-order.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentistopmost
WindowInteractionState
Property WindowInteractionState.
Call IUIAutomationWindowPattern::get_CurrentWindowInteractionState.
Return int, a value in class `WindowInteractionState`,
            the current state of the window for the purposes of user interaction.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentwindowinteractionstate
WindowVisualState
Property WindowVisualState.
Call IUIAutomationWindowPattern::get_CurrentWindowVisualState.
Return int, a value in class `WindowVisualState`,
            the visual state of the window; that is, whether it is in the normal, maximized, or minimized state.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationclient/nf-uiautomationclient-iuiautomationwindowpattern-get_currentwindowvisualstate

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
class WindowVisualState(builtins.object)
    WindowVisualState from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-windowvisualstate
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
Maximized = 1
Minimized = 2
Normal = 0

 
class ZoomUnit(builtins.object)
    ZoomUnit from IUIAutomation.
Refer https://docs.microsoft.com/en-us/windows/win32/api/uiautomationcore/ne-uiautomationcore-zoomunit
 
  Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes defined here:
LargeDecrement = 1
LargeIncrement = 3
NoAmount = 0
SmallDecrement = 2
SmallIncrement = 4

 
class tagPROCESSENTRY32(_ctypes.Structure)
    
Method resolution order:
tagPROCESSENTRY32
_ctypes.Structure
_ctypes._CData
builtins.object

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object
cntThreads
cntUsage
dwFlags
dwSize
pcPriClassBase
szExeFile
th32DefaultHeapID
th32ModuleID
th32ParentProcessID
th32ProcessID

Methods inherited from _ctypes.Structure:
__buffer__(self, flags, /)
Return a buffer object that exposes the underlying memory of the object.
__init__(self, /, *args, **kwargs)
Initialize self.  See help(type(self)) for accurate signature.

Static methods inherited from _ctypes.Structure:
__new__(*args, **kwargs) class method of _ctypes.Structure
Create and return a new object.  See help(type) for accurate signature.

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(self, /)
Return hash(self).
__reduce__(...)
Helper for pickle.
__setstate__(...)

 
Functions
       
BringWindowToTop(handle: int) -> bool
BringWindowToTop from Win32.
handle: int, the handle of a native window.
Return bool, True if succeed otherwise False.
Click(x: int, y: int, waitTime: float = 0.5) -> None
Simulate mouse click at point x, y.
x: int.
y: int.
waitTime: float.
ControlFromCursor() -> Optional[uiautomation.Control]
Call ControlFromPoint with current cursor point.
Return `Control` subclass.
ControlFromCursor2() -> Optional[uiautomation.Control]
Call ControlFromPoint2 with current cursor point.
Return `Control` subclass.
ControlFromHandle(handle: int) -> Optional[uiautomation.Control]
Call IUIAutomation.ElementFromHandle with a native handle.
handle: int, a native window handle.
Return `Control` subclass or None.
ControlFromPoint(x: int, y: int) -> Optional[uiautomation.Control]
Call IUIAutomation ElementFromPoint x,y. May return None if mouse is over cmd's title bar icon.
Return `Control` subclass or None.
ControlFromPoint2(x: int, y: int) -> Optional[uiautomation.Control]
Get a native handle from point x,y and call IUIAutomation.ElementFromHandle.
Return `Control` subclass.
ControlsAreSame(control1: uiautomation.Control, control2: uiautomation.Control) -> bool
control1: `Control` or its subclass.
control2: `Control` or its subclass.
Return bool, True if control1 and control2 represent the same control otherwise False.
CreatePattern(patternId: int, pattern: comtypes.POINTER(IUnknown))
Create a concreate pattern by pattern id and pattern(POINTER(IUnknown)).
DragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
Simulate mouse left button drag from point x1, y1 drop to point x2, y2.
x1: int.
y1: int.
x2: int.
y2: int.
moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster.
waitTime: float.
EnumAndLogControl(control: uiautomation.Control, maxDepth: int = 4294967295, showAllName: bool = True, showPid: bool = False, startDepth: int = 0) -> None
Print and log control and its descendants' propertyies.
control: `Control` or its subclass.
maxDepth: int, enum depth.
showAllName: bool, if False, print the first 30 characters of control.Name.
startDepth: int, control's current depth.
EnumAndLogControlAncestors(control: uiautomation.Control, showAllName: bool = True, showPid: bool = False) -> None
Print and log control and its ancestors' propertyies.
control: `Control` or its subclass.
showAllName: bool, if False, print the first 30 characters of control.Name.
EnumProcessByWMI() -> Generator[uiautomation.ProcessInfo, NoneType, NoneType]
Maybe slower, but can get system processes' info
FindControl(control: Optional[uiautomation.Control], compare: Callable[[uiautomation.Control, int], bool], maxDepth: int = 4294967295, findFromSelf: bool = False, foundIndex: int = 1) -> Optional[uiautomation.Control]
control: `Control` or its subclass.
compare: Callable[[Control, int], bool], function(control: Control, depth: int) -> bool.
maxDepth: int, enum depth.
findFromSelf: bool, if False, do not compare self.
foundIndex: int, starts with 1, >= 1.
Return `Control` subclass or None if not find.
GetAncestor(handle: int, flag: int) -> int
GetAncestor from Win32.
handle: int, the handle of a native window.
index: int, a value in class `GAFlag`.
Return int, a native window handle.
GetClipboardBitmap() -> Optional[uiautomation.Bitmap]
GetClipboardFormats() -> Dict[int, str]
Get clipboard formats that system clipboard has currently.
Return Dict[int, str].
The key is a int value in class `ClipboardFormat` or othes values that apps registered by ctypes.windll.user32.RegisterClipboardFormatW
GetClipboardHtml() -> str
Return str.
Note: the positions(StartHTML, EndHTML ...) are valid for utf-8 encoding html text,
    when the utf-8 encoding html text is decoded to Python unicode str,
    the positions may not correspond to the actual positions in the returned str.
GetClipboardText() -> str
GetConsoleOriginalTitle() -> str
GetConsoleOriginalTitle from Win32.
Return str.
Only available on Windows Vista or higher.
GetConsoleTitle() -> str
GetConsoleTitle from Win32.
Return str.
GetConsoleWindow() -> Optional[uiautomation.WindowControl]
Return `WindowControl` or None, a console window that runs python.
GetCursorPos() -> Tuple[int, int]
GetCursorPos from Win32.
Get current mouse cursor positon.
Return Tuple[int, int], two ints tuple (x, y).
GetDoubleClickTime() -> int
GetDoubleClickTime from Win32.
Return int, in milliseconds.
GetEditText(handle: int) -> str
Get text of a native Win32 Edit.
handle: int, the handle of a native window.
Return str.
GetFocusedControl() -> Optional[uiautomation.Control]
Return `Control` subclass.
GetForegroundControl() -> uiautomation.Control
Return `Control` subclass.
GetForegroundWindow() -> int
GetForegroundWindow from Win32.
Return int, the native handle of the foreground window.
GetMonitorsRect() -> List[uiautomation.Rect]
Get monitors' rect.
Return List[Rect].
GetPatternIdInterface(patternId: int)
Get pattern COM interface by pattern id.
patternId: int, a value in class `PatternId`.
Return comtypes._cominterface_meta.
GetPhysicalCursorPos() -> Tuple[int, int]
GetPhysicalCursorPos from Win32.
Get current mouse cursor positon.
Return Tuple[int, int], two ints tuple (x, y).
GetPixelColor(x: int, y: int, handle: int = 0) -> int
Get pixel color of a native window.
x: int.
y: int.
handle: int, the handle of a native window.
Return int, the bgr value of point (x,y).
r = bgr & 0x0000FF
g = (bgr & 0x00FF00) >> 8
b = (bgr & 0xFF0000) >> 16
If handle is 0, get pixel from Desktop window(root control).
Note:
Not all devices support GetPixel.
An application should call GetDeviceCaps to determine whether a specified device supports this function.
For example, console window doesn't support.
GetProcesses(detailedInfo: bool = True) -> List[uiautomation.ProcessInfo]
Enum process by Win32 API.
detailedInfo: bool, only get pid and exeName if False.
You should run python as administrator to call this function.
Can not get some system processes' info.
GetRootControl() -> uiautomation.PaneControl
Get root control, the Desktop window.
Return `PaneControl`.
GetScreenSize() -> Tuple[int, int]
Return Tuple[int, int], two ints tuple (width, height).
GetVirtualScreenSize() -> Tuple[int, int]
Return Tuple[int, int], two ints tuple (width, height).
GetWindowLong(handle: int, index: int) -> int
GetWindowLong from Win32.
handle: int, the handle of a native window.
index: int.
GetWindowText(handle: int) -> str
GetWindowText from Win32.
handle: int, the handle of a native window.
Return str.
HardwareInput(uMsg: int, param: int = 0) -> uiautomation.INPUT
Create Win32 struct `HARDWAREINPUT` for `SendInput`.
InitializeUIAutomationInCurrentThread() -> None
Initialize UIAutomation in a new thread.
If you want to use functionalities related to Controls and Patterns in a new thread.
You must call this function first in the new thread.
But you can't use use a Control or a Pattern created in a different thread.
So you can't create a Control or a Pattern in main thread and then pass it to a new thread and use it.
Input(prompt: str, consoleColor: int = -1) -> str
InputColorfully(prompt: str, consoleColor: int = -1) -> str
IsDesktopLocked() -> bool
Check if desktop is locked.
Return bool.
Desktop is locked if press Win+L, Ctrl+Alt+Del or in remote desktop mode.
IsIconic(handle: int) -> bool
IsIconic from Win32.
Determine whether a native window is minimized.
handle: int, the handle of a native window.
Return bool.
IsKeyPressed(key: int) -> bool
key: int, a value in class `Keys`.
Return bool.
IsProcess64Bit(processId: int) -> Optional[bool]
Return True if process is 64 bit.
Return False if process is 32 bit.
Return None if unknown, maybe caused by having no access right to the process.
IsTopLevelWindow(handle: int) -> bool
IsTopLevelWindow from Win32.
handle: int, the handle of a native window.
Return bool.
Only available on Windows 7 or Higher.
IsUserAnAdmin() -> bool
IsUserAnAdmin from Win32.
Return bool.
Minimum supported OS: Windows XP, Windows Server 2003
IsWindowVisible(handle: int) -> bool
IsWindowVisible from Win32.
handle: int, the handle of a native window.
Return bool.
IsZoomed(handle: int) -> bool
IsZoomed from Win32.
Determine whether a native window is maximized.
handle: int, the handle of a native window.
Return bool.
KeyboardInput(wVk: int, wScan: int, dwFlags: int = 0, time_: int = 0) -> uiautomation.INPUT
Create Win32 struct `KEYBDINPUT` for `SendInput`.
LogControl(control: uiautomation.Control, depth: int = 0, showAllName: bool = True, showPid: bool = False) -> None
Print and log control's properties.
control: `Control` or its subclass.
depth: int, current depth.
showAllName: bool, if False, print the first 30 characters of control.Name.
MessageBox(content: str, title: str, flags: int = 0) -> int
MessageBox from Win32.
content: str.
title: str.
flags: int, a value or some combined values in class `MB`.
Return int, a value in MB whose name starts with Id, such as MB.IdOk
MiddleClick(x: int, y: int, waitTime: float = 0.5) -> None
Simulate mouse middle click at point x, y.
x: int.
y: int.
waitTime: float.
MiddleDragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
Simulate mouse middle button drag from point x1, y1 drop to point x2, y2.
x1: int.
y1: int.
x2: int.
y2: int.
moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster.
waitTime: float.
MiddlePressMouse(x: int, y: int, waitTime: float = 0.5) -> None
Press middle mouse.
x: int.
y: int.
waitTime: float.
MiddleReleaseMouse(waitTime: float = 0.5) -> None
Release middle mouse.
waitTime: float.
MouseInput(dx: int, dy: int, mouseData: int = 0, dwFlags: int = 2, time_: int = 0) -> uiautomation.INPUT
Create Win32 struct `MOUSEINPUT` for `SendInput`.
Return `INPUT`.
MoveTo(x: int, y: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
Simulate mouse move to point x, y from current cursor.
x: int.
y: int.
moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster.
waitTime: float.
MoveWindow(handle: int, x: int, y: int, width: int, height: int, repaint: int = 1) -> bool
MoveWindow from Win32.
handle: int, the handle of a native window.
x: int.
y: int.
width: int.
height: int.
repaint: int, use 1 or 0.
Return bool, True if succeed otherwise False.
PlayWaveFile(filePath: str = 'C:\\Windows\\Media\\notify.wav', isAsync: bool = False, isLoop: bool = False) -> bool
Call PlaySound from Win32.
filePath: str, if emtpy, stop playing the current sound.
isAsync: bool, if True, the sound is played asynchronously and returns immediately.
isLoop: bool, if True, the sound plays repeatedly until PlayWaveFile(None) is called again, must also set isAsync to True.
Return bool, True if succeed otherwise False.
PostMessage(handle: int, msg: int, wParam: int, lParam: int) -> bool
PostMessage from Win32.
Return bool, True if succeed otherwise False.
PressKey(key: int, waitTime: float = 0.5) -> None
Simulate a key down for key.
key: int, a value in class `Keys`.
waitTime: float.
PressMouse(x: int, y: int, waitTime: float = 0.5) -> None
Press left mouse.
x: int.
y: int.
waitTime: float.
ProcessTime = perf_counter(...)
perf_counter() -> float
 
Performance counter for benchmarking.
ReleaseKey(key: int, waitTime: float = 0.5) -> None
Simulate a key up for key.
key: int, a value in class `Keys`.
waitTime: float.
ReleaseMouse(waitTime: float = 0.5) -> None
Release left mouse.
waitTime: float.
ResetConsoleColor() -> bool
Reset to the default text color on console window.
Return bool, True if succeed otherwise False.
RightClick(x: int, y: int, waitTime: float = 0.5) -> None
Simulate mouse right click at point x, y.
x: int.
y: int.
waitTime: float.
RightDragDrop(x1: int, y1: int, x2: int, y2: int, moveSpeed: float = 1, waitTime: float = 0.5) -> None
Simulate mouse right button drag from point x1, y1 drop to point x2, y2.
x1: int.
y1: int.
x2: int.
y2: int.
moveSpeed: float, 1 normal speed, < 1 move slower, > 1 move faster.
waitTime: float.
RightPressMouse(x: int, y: int, waitTime: float = 0.5) -> None
Press right mouse.
x: int.
y: int.
waitTime: float.
RightReleaseMouse(waitTime: float = 0.5) -> None
Release right mouse.
waitTime: float.
RunByHotKey(keyFunctions: Dict[Tuple[int, int], Callable], stopHotKey: Optional[Tuple[int, int]] = None, exitHotKey: Tuple[int, int] = (2, 68), waitHotKeyReleased: bool = True) -> None
Bind functions with hotkeys, the function will be run or stopped in another thread when the hotkey is pressed.
keyFunctions: Dict[Tuple[int, int], Callable], such as {(uiautomation.ModifierKey.Control, uiautomation.Keys.VK_1) : function}
stopHotKey: hotkey tuple
exitHotKey: hotkey tuple
waitHotKeyReleased: bool, if True, hotkey function will be triggered after the hotkey is released
 
def main(stopEvent):
    while True:
        if stopEvent.is_set(): # must check stopEvent.is_set() if you want to stop when stop hotkey is pressed
            break
        print(n)
        n += 1
        stopEvent.wait(1)
    print('main exit')
 
uiautomation.RunByHotKey({(uiautomation.ModifierKey.Control, uiautomation.Keys.VK_1) : main}
                    , (uiautomation.ModifierKey.Control | uiautomation.ModifierKey.Shift, uiautomation.Keys.VK_2))
RunScriptAsAdmin(argv: List[str], workingDirectory: str = None, showFlag: int = 1) -> bool
Run a python script as administrator.
System will show a popup dialog askes you whether to elevate as administrator if UAC is enabled.
argv: List[str], a str list like sys.argv, argv[0] is the script file, argv[1:] are other arguments.
workingDirectory: str, the working directory for the script file.
showFlag: int, a value in class `SW`.
Return bool, True if succeed.
SendInput(*inputs) -> int
SendInput from Win32.
input: `INPUT`.
Return int, the number of events that it successfully inserted into the keyboard or mouse input stream.
            If the function returns zero, the input was already blocked by another thread.
SendKey(key: int, waitTime: float = 0.5) -> None
Simulate typing a key.
key: int, a value in class `Keys`.
SendKeys(text: str, interval: float = 0.01, waitTime: float = 0.5, charMode: bool = True, debug: bool = False) -> None
Simulate typing keys on keyboard.
text: str, keys to type.
interval: float, seconds between keys.
waitTime: float.
charMode: bool, if False, the text typed is depend on the input method if a input method is on.
debug: bool, if True, print the keys.
Examples:
{Ctrl}, {Delete} ... are special keys' name in SpecialKeyNames.
SendKeys('{Ctrl}a{Delete}{Ctrl}v{Ctrl}s{Ctrl}{Shift}s{Win}e{PageDown}') #press Ctrl+a, Delete, Ctrl+v, Ctrl+s, Ctrl+Shift+s, Win+e, PageDown
SendKeys('{Ctrl}(AB)({Shift}(123))') #press Ctrl+A+B, type '(', press Shift+1+2+3, type ')', if '()' follows a hold key, hold key won't release util ')'
SendKeys('{Ctrl}{a 3}') #press Ctrl+a at the same time, release Ctrl+a, then type 'a' 2 times
SendKeys('{a 3}{B 5}') #type 'a' 3 times, type 'B' 5 times
SendKeys('{{}Hello{}}abc {a}{b}{c} test{} 3}{!}{a} (){(}{)}') #type: '{Hello}abc abc test}}}!a ()()'
SendKeys('0123456789{Enter}')
SendKeys('ABCDEFGHIJKLMNOPQRSTUVWXYZ{Enter}')
SendKeys('abcdefghijklmnopqrstuvwxyz{Enter}')
SendKeys('`~!@#$%^&*()-_=+{Enter}')
SendKeys('[]{{}{}}\|;:'",<.>/?{Enter}')
SendMessage(handle: int, msg: int, wParam: int, lParam: int) -> int
SendMessage from Win32.
Return int, the return value specifies the result of the message processing;
            it depends on the message sent.
SendUnicodeChar(char: str, charMode: bool = True) -> int
Type a single unicode char.
char: str, len(char) must equal to 1.
charMode: bool, if False, the char typied is depend on the input method if a input method is on.
Return int, the number of events that it successfully inserted into the keyboard or mouse input stream.
            If the function returns zero, the input was already blocked by another thread.
SetClipboardBitmap(bitmap: uiautomation.Bitmap) -> bool
Return bool, True if succeed otherwise False.
SetClipboardHtml(htmlText: str) -> bool
htmlText: str, such as '<h1>Title</h1><h3>Hello</h3><p>hello world</p>'
Return bool, True if succeed otherwise False.
Refer: https://docs.microsoft.com/en-us/troubleshoot/cpp/add-html-code-clipboard
SetClipboardText(text: str) -> bool
Return bool, True if succeed otherwise False.
SetConsoleColor(color: int) -> bool
Change the text color on console window.
color: int, a value in class `ConsoleColor`.
Return bool, True if succeed otherwise False.
SetConsoleTitle(text: str) -> bool
SetConsoleTitle from Win32.
text: str.
Return bool, True if succeed otherwise False.
SetCursorPos(x: int, y: int) -> bool
SetCursorPos from Win32.
Set mouse cursor to point x, y.
x: int.
y: int.
Return bool, True if succeed otherwise False.
SetForegroundWindow(handle: int) -> bool
SetForegroundWindow from Win32.
handle: int, the handle of a native window.
Return bool, True if succeed otherwise False.
SetGlobalSearchTimeout(seconds: float) -> None
seconds: float.
To make this available, you need explicitly import uiautomation:
    from uiautomation import uiautomation as auto
    auto.SetGlobalSearchTimeout(10)
SetProcessDpiAwareness(dpiAwareness: int)
ProcessDpiAwareness from Win32.
dpiAwareness: int, a value in class `ProcessDpiAwareness`
SetThreadDpiAwarenessContext(dpiAwarenessContext: int)
SetThreadDpiAwarenessContext from Win32.
dpiAwarenessContext: int, a value in class `DpiAwarenessContext`
SetWindowLong(handle: int, index: int, value: int) -> int
SetWindowLong from Win32.
handle: int, the handle of a native window.
index: int.
value: int.
Return int, the previous value before set.
SetWindowPos(handle: int, hWndInsertAfter: int, x: int, y: int, width: int, height: int, flags: int) -> bool
SetWindowPos from Win32.
handle: int, the handle of a native window.
hWndInsertAfter: int, a value whose name starts with 'HWND' in class SWP.
x: int.
y: int.
width: int.
height: int.
flags: int, values whose name starts with 'SWP' in class `SWP`.
Return bool, True if succeed otherwise False.
SetWindowText(handle: int, text: str) -> bool
SetWindowText from Win32.
handle: int, the handle of a native window.
text: str.
Return bool, True if succeed otherwise False.
SetWindowTopmost(handle: int, isTopmost: bool) -> bool
handle: int, the handle of a native window.
isTopmost: bool
Return bool, True if succeed otherwise False.
ShowDesktop(waitTime: float = 1) -> None
Show Desktop by pressing win + d
ShowWindow(handle: int, cmdShow: int) -> bool
ShowWindow from Win32.
handle: int, the handle of a native window.
cmdShow: int, a value in clas `SW`.
Return bool, True if succeed otherwise False.
SwitchToThisWindow(handle: int) -> None
SwitchToThisWindow from Win32.
handle: int, the handle of a native window.
TerminateProcess(pid: int) -> bool
TerminateProcessByName(exeName: str, killAll: bool = True) -> int
exeName: str, such as notepad.exe
return int, process count that was terminated
UninitializeUIAutomationInCurrentThread() -> None
Uninitialize UIAutomation in a new thread after calling InitializeUIAutomationInCurrentThread.
You must call this function when the new thread exits if you have called InitializeUIAutomationInCurrentThread in the same thread.
WaitForDisappear(control: uiautomation.Control, timeout: float) -> bool
Check if control disappears in timeout seconds.
control: `Control` or its subclass.
timeout: float.
Return bool.
WaitForExist(control: uiautomation.Control, timeout: float) -> bool
Check if control exists in timeout seconds.
control: `Control` or its subclass.
timeout: float.
Return bool.
WaitHotKeyReleased(hotkey: Tuple[int, int]) -> None
hotkey: Tuple[int, int], two ints tuple (modifierKey, key)
WalkControl(control: uiautomation.Control, includeTop: bool = False, maxDepth: int = 4294967295) -> Generator[Tuple[uiautomation.Control, int], NoneType, NoneType]
control: `Control` or its subclass.
includeTop: bool, if True, yield (control, 0) first.
maxDepth: int, enum depth.
Yield 2 items tuple (control: Control, depth: int).
WalkTree(top, getChildren: Optional[Callable[[Any], List[Any]]] = None, getFirstChild: Optional[Callable[[Any], Any]] = None, getNextSibling: Optional[Callable[[Any], Any]] = None, yieldCondition: Optional[Callable[[Any, int], bool]] = None, includeTop: bool = False, maxDepth: int = 4294967295)
Walk a tree not using recursive algorithm.
top: a tree node.
getChildren: Callable[[TreeNode], List[TreeNode]], function(treeNode: TreeNode) -> List[TreeNode].
getNextSibling: Callable[[TreeNode], TreeNode], function(treeNode: TreeNode) -> TreeNode.
getNextSibling: Callable[[TreeNode], TreeNode], function(treeNode: TreeNode) -> TreeNode.
yieldCondition: Callable[[TreeNode, int], bool], function(treeNode: TreeNode, depth: int) -> bool.
includeTop: bool, if True yield top first.
maxDepth: int, enum depth.
 
If getChildren is valid, ignore getFirstChild and getNextSibling,
    yield 3 items tuple: (treeNode, depth, remain children count in current depth).
If getChildren is not valid, using getFirstChild and getNextSibling,
    yield 2 items tuple: (treeNode, depth).
If yieldCondition is not None, only yield tree nodes that yieldCondition(treeNode: TreeNode, depth: int)->bool returns True.
 
For example:
def GetDirChildren(dir_):
    if os.path.isdir(dir_):
        return [os.path.join(dir_, it) for it in os.listdir(dir_)]
for it, depth, leftCount in WalkTree('D:\', getChildren= GetDirChildren):
    print(it, depth, leftCount)
WheelDown(wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Simulate mouse wheel down.
wheelTimes: int.
interval: float.
waitTime: float.
WheelUp(wheelTimes: int = 1, interval: float = 0.05, waitTime: float = 0.5) -> None
Simulate mouse wheel up.
wheelTimes: int.
interval: float.
waitTime: float.
WindowFromPoint(x: int, y: int) -> int
WindowFromPoint from Win32.
Return int, a native window handle.
keybd_event(bVk: int, bScan: int, dwFlags: int, dwExtraInfo: int) -> None
keybd_event from Win32.
mouse_event(dwFlags: int, dx: int, dy: int, dwData: int, dwExtraInfo: int) -> None
mouse_event from Win32.

 
Data
        AUTHOR_MAIL = 'yinkaisheng@foxmail.com'
Callable = typing.Callable
CharacterCodes = {' ': 32, "'": 222, ',': 188, '-': 189, '.': 190, '/': 191, '0': 48, '1': 49, '2': 50, '3': 51, ...}
ControlConstructors = {50000: <class 'uiautomation.ButtonControl'>, 50001: <class 'uiautomation.CalendarControl'>, 50002: <class 'uiautomation.CheckBoxControl'>, 50003: <class 'uiautomation.ComboBoxControl'>, 50004: <class 'uiautomation.EditControl'>, 50005: <class 'uiautomation.HyperlinkControl'>, 50006: <class 'uiautomation.ImageControl'>, 50007: <class 'uiautomation.ListItemControl'>, 50008: <class 'uiautomation.ListControl'>, 50009: <class 'uiautomation.MenuControl'>, ...}
ControlTypeNames = {50000: 'ButtonControl', 50001: 'CalendarControl', 50002: 'CheckBoxControl', 50003: 'ComboBoxControl', 50004: 'EditControl', 50005: 'HyperlinkControl', 50006: 'ImageControl', 50007: 'ListItemControl', 50008: 'ListControl', 50009: 'MenuControl', ...}
CurrentProcessIs64Bit = True
DEBUG_EXIST_DISAPPEAR = False
DEBUG_SEARCH_TIME = False
Dict = typing.Dict
Generator = typing.Generator
IsNT6orHigher = True
IsPy38OrHigher = True
List = typing.List
MAX_MOVE_SECOND = 1
MAX_PATH = 260
METRO_WINDOW_CLASS_NAME = 'Windows.UI.Core.CoreWindow'
OPERATION_WAIT_TIME = 0.5
Optional = typing.Optional
PatternConstructors = {10000: <class 'uiautomation.InvokePattern'>, 10001: <class 'uiautomation.SelectionPattern'>, 10002: <class 'uiautomation.ValuePattern'>, 10003: <class 'uiautomation.RangeValuePattern'>, 10004: <class 'uiautomation.ScrollPattern'>, 10005: <class 'uiautomation.ExpandCollapsePattern'>, 10006: <class 'uiautomation.GridPattern'>, 10007: <class 'uiautomation.GridItemPattern'>, 10008: <class 'uiautomation.MultipleViewPattern'>, 10009: <class 'uiautomation.WindowPattern'>, ...}
PatternIdNames = {10000: 'InvokePattern', 10001: 'SelectionPattern', 10002: 'ValuePattern', 10003: 'RangeValuePattern', 10004: 'ScrollPattern', 10005: 'ExpandCollapsePattern', 10006: 'GridPattern', 10007: 'GridItemPattern', 10008: 'MultipleViewPattern', 10009: 'WindowPattern', ...}
PropertyIdNames = {30000: 'RuntimeIdProperty', 30001: 'BoundingRectangleProperty', 30002: 'ProcessIdProperty', 30003: 'ControlTypeProperty', 30004: 'LocalizedControlTypeProperty', 30005: 'NameProperty', 30006: 'AcceleratorKeyProperty', 30007: 'AccessKeyProperty', 30008: 'HasKeyboardFocusProperty', 30009: 'IsKeyboardFocusableProperty', ...}
SEARCH_INTERVAL = 0.5
S_OK = 0
Sequence = typing.Sequence
SpecialKeyNames = {'ACCEPT': 30, 'ADD': 107, 'ALT': 18, 'APPS': 93, 'ATTN': 246, 'BACK': 8, 'BROWSER_BACK': 166, 'BROWSER_FAVORITES': 171, 'BROWSER_FORWARD': 167, 'BROWSER_HOME': 172, ...}
TIME_OUT_SECOND = 10
Tuple = typing.Tuple
Union = typing.Union