pywinauto.controls.common_controls

Classes that wrap the Windows Common controls

class pywinauto.controls.common_controls._toolbar_button(index_, tb_handle)

Bases: object

Wrapper around Toolbar button (TBBUTTONINFO) items

Click(button='left', pressed='')

Click on the Toolbar button

ClickInput(button='left', double=False, wheel_dist=0, pressed='')

Click on the Toolbar button

HasStyle(style)

Return True if the button has the specified style

IsCheckable()

Return if the button can be checked

IsChecked()

Return if the button is in the checked state

IsEnabled()

Return if the button is in the pressed state

IsPressable()

Return if the button can be pressed

IsPressed()

Return if the button is in the pressed state

Rectangle()

Get the rectangle of a button on the toolbar

State()

Return the state of the button

Style()

Return the style of the button

Text()

Return the text of the button

click(button='left', pressed='')

Click on the Toolbar button

click_input(button='left', double=False, wheel_dist=0, pressed='')

Click on the Toolbar button

has_style(style)

Return True if the button has the specified style

is_checkable()

Return if the button can be checked

is_checked()

Return if the button is in the checked state

is_enabled()

Return if the button is in the pressed state

is_pressable()

Return if the button can be pressed

is_pressed()

Return if the button is in the pressed state

rectangle()

Get the rectangle of a button on the toolbar

state()

Return the state of the button

style()

Return the style of the button

text()

Return the text of the button

class pywinauto.controls.common_controls._treeview_element(elem, tv_handle)

Bases: object

Wrapper around TreeView items

Children()

Return the direct children of this control

Click(button='left', double=False, where='text', pressed='')

Click on the treeview item

where can be any one of “text”, “icon”, “button”, “check” defaults to “text”

ClickInput(button='left', double=False, wheel_dist=0, where='text', pressed='')

Click on the treeview item

where can be any one of “text”, “icon”, “button”, “check” defaults to “text”

ClientRect(text_area_rect=True)

Return a rectangle of a text area of the item

If text_area_rect is set to False then it will return a rectangle for the whole item (usually left is equal to 0). Defaults to True - which returns just the rectangle of the text of the item

Collapse()

Collapse the children of this tree view item

Drop(button='left', pressed='')

Drop at the item

EnsureVisible()

Make sure that the TreeView item is visible

Expand()

Expand the children of this tree view item

GetChild(child_spec, exact=False)

Return the child item of this item

Accepts either a string or an index. If a string is passed then it returns the child item with the best match for the string.

IsChecked()

Return whether the TreeView item is checked or not

IsExpanded()

Indicate that the TreeView item is selected or not

IsSelected()

Indicate that the TreeView item is selected or not

Item()

Return the item itself

Next()

Return the next item

Select()

Select the TreeView item

StartDragging(button='left', pressed='')

Start dragging the item

State()

Return the state of the item

SubElements()

Return the list of children of this control

Text()

Return the text of the item

children()

Return the direct children of this control

click(button='left', double=False, where='text', pressed='')

Click on the treeview item

where can be any one of “text”, “icon”, “button”, “check” defaults to “text”

click_input(button='left', double=False, wheel_dist=0, where='text', pressed='')

Click on the treeview item

where can be any one of “text”, “icon”, “button”, “check” defaults to “text”

client_rect(text_area_rect=True)

Return a rectangle of a text area of the item

If text_area_rect is set to False then it will return a rectangle for the whole item (usually left is equal to 0). Defaults to True - which returns just the rectangle of the text of the item

collapse()

Collapse the children of this tree view item

drop(button='left', pressed='')

Drop at the item

ensure_visible()

Make sure that the TreeView item is visible

expand()

Expand the children of this tree view item

get_child(child_spec, exact=False)

Return the child item of this item

Accepts either a string or an index. If a string is passed then it returns the child item with the best match for the string.

is_checked()

Return whether the TreeView item is checked or not

is_expanded()

Indicate that the TreeView item is selected or not

is_selected()

Indicate that the TreeView item is selected or not

item()

Return the item itself

next_item()

Return the next item

select()

Select the TreeView item

start_dragging(button='left', pressed='')

Start dragging the item

state()

Return the state of the item

sub_elements()

Return the list of children of this control

text()

Return the text of the item

class pywinauto.controls.common_controls._listview_item(lv_ctrl, item_index, subitem_index=0)

Bases: object

Wrapper around ListView items

Check()

Check the ListView item

Click(button='left', double=False, where='text', pressed='')

Click on the list view item

where can be any one of “all”, “icon”, “text”, “select”, “check” defaults to “text”

ClickInput(button='left', double=False, wheel_dist=0, where='text', pressed='')

Click on the list view item

where can be any one of “all”, “icon”, “text”, “select”, “check” defaults to “text”

Deselect()

Mark the item as not selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

EnsureVisible()

Make sure that the ListView item is visible

Image()

Return the image index of the item

Indent()

Return the indent of the item

IsChecked()

Return whether the ListView item is checked or not

IsFocused()

Return True if the item has the focus

IsSelected()

Return True if the item is selected

Item()

Return the item itself (LVITEM instance)

ItemData()

Return the item data (dictionary)

Rectangle(area='all')

Return the rectangle of the item.

Possible area values:

  • "all" Returns the bounding rectangle of the entire item, including the icon and label.
  • "icon" Returns the bounding rectangle of the icon or small icon.
  • "text" Returns the bounding rectangle of the item text.
  • "select" Returns the union of the “icon” and “text” rectangles, but excludes columns in report view.
Select()

Mark the item as selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

State()

Return the state of the item

Text()

Return the text of the item

UnCheck()

Uncheck the ListView item

check()

Check the ListView item

click(button='left', double=False, where='text', pressed='')

Click on the list view item

where can be any one of “all”, “icon”, “text”, “select”, “check” defaults to “text”

click_input(button='left', double=False, wheel_dist=0, where='text', pressed='')

Click on the list view item

where can be any one of “all”, “icon”, “text”, “select”, “check” defaults to “text”

deselect()

Mark the item as not selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

ensure_visible()

Make sure that the ListView item is visible

image()

Return the image index of the item

indent()

Return the indent of the item

is_checked()

Return whether the ListView item is checked or not

is_focused()

Return True if the item has the focus

is_selected()

Return True if the item is selected

item()

Return the item itself (LVITEM instance)

item_data()

Return the item data (dictionary)

rectangle(area='all')

Return the rectangle of the item.

Possible area values:

  • "all" Returns the bounding rectangle of the entire item, including the icon and label.
  • "icon" Returns the bounding rectangle of the icon or small icon.
  • "text" Returns the bounding rectangle of the item text.
  • "select" Returns the union of the “icon” and “text” rectangles, but excludes columns in report view.
select()

Mark the item as selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

state()

Return the state of the item

text()

Return the text of the item

uncheck()

Uncheck the ListView item

class pywinauto.controls.common_controls.AnimationWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Animation common control

controltypes = []
friendlyclassname = 'Animation'
windowclasses = ['SysAnimate32']
class pywinauto.controls.common_controls.CalendarWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Calendar common control

calc_min_rectangle(left, top, right, bottom)

Calculates the minimum size that a rectangle needs to be to fit that number of calendars

controltypes = [<MagicMock name='mock.client.GetModule().UIA_CalendarControlTypeId' id='139623340727376'>]
count()

Get the calendars count

friendlyclassname = 'Calendar'
get_border()

Get the calendar border

get_current_date()

Get the currently selected date

get_first_weekday()

Get is not in current locale and if so first day of the week

get_id()

Get type of calendar

get_month_delta()

Retrieves the scroll rate for a month calendar control

get_month_range(scope_of_range)

Retrieves date information that represents the high and low limits of a month calendar control’s display.

get_today()

Get today date

get_view()

Get the calendar view

has_title = False
hit_test(x, y)

Determines which portion of a month calendar control is at a given point on the screen

place_in_calendar = {'background': <MagicMock name='mock.win32defines.MCSC_BACKGROUND' id='139623340768560'>, 'text': <MagicMock name='mock.win32defines.MCSC_TEXT' id='139623340781296'>, 'trailing_text': <MagicMock name='mock.win32defines.MCSC_TRAILINGTEXT' id='139623340822992'>, 'month_background': <MagicMock name='mock.win32defines.MCSC_MONTHBK' id='139623340772880'>, 'title_text': <MagicMock name='mock.win32defines.MCSC_TITLETEXT' id='139623340802288'>, 'title_background': <MagicMock name='mock.win32defines.MCSC_TITLEBK' id='139623340789712'>}
set_border(border)

Set the calendar border

set_color(place_of_color, red, green, blue)

Set some color in some place of calendar which you specify.

Receive four parameters: - The first parameter may take few variants below: ‘background’, ‘month_background’, ‘text’, ‘title_background’, ‘title_text’, ‘trailing_text’ ; - All other parameters should be integer from 0 to 255.

set_current_date(year, month, day_of_week, day)

Set the currently selected date

set_day_states(month_states)

Sets the day states for all months that are currently visible

set_first_weekday(dayNum)

Set first day of the week

set_id(ID)

Set the calendar type.

Receive only one parameter, which takes variants below: ‘gregorian’, ‘gregorian_us’, ‘japan’, ‘taiwan’, ‘korea’, ‘hijri’, ‘thai’, ‘hebrew’, ‘gregorian_me_french’, ‘gregorian_arabic’, ‘gregorian_english_xlit’, ‘gregorian_french_xlit’, ‘umalqura’

set_month_delta(delta)

Sets the scroll rate for a month calendar control.

set_today(year, month, day)

Set today date

set_view(viewType)

Set the calendar view

windowclasses = ['SysMonthCal32']
class pywinauto.controls.common_controls.ComboBoxExWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows ComboBoxEx common control

controltypes = []
friendlyclassname = 'ComboBoxEx'
has_title = False
windowclasses = ['ComboBoxEx32']
class pywinauto.controls.common_controls.DateTimePickerWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows DateTimePicker common control

GetTime()

Get the currently selected time

SetTime(year, month, day_of_week, day, hour, minute, second, milliseconds)

Get the currently selected time

controltypes = []
friendlyclassname = 'DateTimePicker'
get_time()

Get the currently selected time

has_title = False
set_time(year, month, day_of_week, day, hour, minute, second, milliseconds)

Get the currently selected time

windowclasses = ['SysDateTimePick32']
class pywinauto.controls.common_controls.HeaderWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows ListView Header common control

GetColumnRectangle(column_index)

Return the rectangle for the column specified by column_index

GetColumnText(column_index)

Return the text for the column specified by column_index

ItemCount()

Return the number of columns in this header

client_rects()

Return all the client rectangles for the header control

controltypes = [<MagicMock name='mock.client.GetModule().UIA_HeaderControlTypeId' id='139623341398224'>]
friendlyclassname = 'Header'
get_column_rectangle(column_index)

Return the rectangle for the column specified by column_index

get_column_text(column_index)

Return the text for the column specified by column_index

item_count()

Return the number of columns in this header

texts()

Return the texts of the Header control

windowclasses = ['SysHeader32', 'msvb_lib_header']
class pywinauto.controls.common_controls.HotkeyWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Hotkey common control

controltypes = []
friendlyclassname = 'Hotkey'
has_title = False
windowclasses = ['msctls_hotkey32']
class pywinauto.controls.common_controls.IPAddressWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows IPAddress common control

controltypes = []
friendlyclassname = 'IPAddress'
has_title = False
windowclasses = ['SysIPAddress32']
class pywinauto.controls.common_controls.ListViewWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows ListView common control

This class derives from HwndWrapper - so has all the methods o that class also

see hwndwrapper.HwndWrapper

Check(item)

Check the ListView item

ColumnCount()

Return the number of columns

ColumnWidths()

Return a list of all the column widths

Columns()

Get the information on the columns of the ListView

Deselect(item)

Mark the item as not selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

GetColumn(col_index)

Get the information for a column of the ListView

GetHeaderControl()

Returns the Header control associated with the ListView

GetItem(item_index, subitem_index=0)

Return the item of the list view”

  • item_index Can be either an index of the item or a string with the text of the item you want returned.
  • subitem_index A zero based index of the item you want returned. Defaults to 0.
GetItemRect(item_index)

Return the bounding rectangle of the list view item

GetSelectedCount()

Return the number of selected items

IsFocused(item)

Return True if the item has the focus

IsSelected(item)

Return True if the item is selected

Item(item_index, subitem_index=0)

Return the item of the list view”

  • item_index Can be either an index of the item or a string with the text of the item you want returned.
  • subitem_index A zero based index of the item you want returned. Defaults to 0.
ItemCount()

The number of items in the ListView

Items()

Get all the items in the list view

Select(item)

Mark the item as selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

UnCheck(item)

Uncheck the ListView item

check(item)

Check the ListView item

column_count()

Return the number of columns

column_widths()

Return a list of all the column widths

columns()

Get the information on the columns of the ListView

controltypes = []
deselect(item)

Mark the item as not selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

friendlyclassname = 'ListView'
get_column(col_index)

Get the information for a column of the ListView

get_header_control()

Returns the Header control associated with the ListView

get_item(item_index, subitem_index=0)

Return the item of the list view”

  • item_index Can be either an index of the item or a string with the text of the item you want returned.
  • subitem_index A zero based index of the item you want returned. Defaults to 0.
get_item_rect(item_index)

Return the bounding rectangle of the list view item

get_selected_count()

Return the number of selected items

is_checked(item)

Return whether the ListView item is checked or not

is_focused(item)

Return True if the item has the focus

is_selected(item)

Return True if the item is selected

item(item_index, subitem_index=0)

Return the item of the list view”

  • item_index Can be either an index of the item or a string with the text of the item you want returned.
  • subitem_index A zero based index of the item you want returned. Defaults to 0.
item_count()

The number of items in the ListView

items()

Get all the items in the list view

select(item)

Mark the item as selected

The ListView control must be enabled and visible before an Item can be selected otherwise an exception is raised

texts()

Get the texts for the ListView control

uncheck(item)

Uncheck the ListView item

windowclasses = ['SysListView32', 'WindowsForms\\d*\\.SysListView32\\..*', 'TSysListView', 'ListView.*WndClass']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.PagerWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Pager common control

GetPosition()

Return the current position of the pager

SetPosition(pos)

Set the current position of the pager

controltypes = []
friendlyclassname = 'Pager'
get_position()

Return the current position of the pager

set_position(pos)

Set the current position of the pager

windowclasses = ['SysPager']
class pywinauto.controls.common_controls.ProgressWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Progress common control

GetPosition()

Return the current position of the progress bar

GetState()

Get the state of the progress bar

State will be one of the following constants:
  • PBST_NORMAL
  • PBST_ERROR
  • PBST_PAUSED
GetStep()

Get the step size of the progress bar

SetPosition(pos)

Set the current position of the progress bar

StepIt()

Move the progress bar one step size forward

controltypes = [<MagicMock name='mock.client.GetModule().UIA_ProgressBarControlTypeId' id='139623340836400'>]
friendlyclassname = 'Progress'
get_position()

Return the current position of the progress bar

get_step()

Get the step size of the progress bar

has_title = False
set_position(pos)

Set the current position of the progress bar

set_state()

Get the state of the progress bar

State will be one of the following constants:
  • PBST_NORMAL
  • PBST_ERROR
  • PBST_PAUSED
step_it()

Move the progress bar one step size forward

windowclasses = ['msctls_progress', 'msctls_progress32']
class pywinauto.controls.common_controls.ReBarWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows ReBar common control

BandCount()

Return the number of bands in the control

GetBand(band_index)

Get a band of the ReBar control

GetToolTipsControl()

Return the tooltip control associated with this control

band_count()

Return the number of bands in the control

controltypes = []
friendlyclassname = 'ReBar'
get_band(band_index)

Get a band of the ReBar control

get_tool_tips_control()

Return the tooltip control associated with this control

texts()

Return the texts of the Rebar

windowclasses = ['ReBarWindow32']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.StatusBarWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Status Bar common control

BorderWidths()

Return the border widths of the StatusBar

A dictionary of the 3 available widths is returned: Horizontal - the horizontal width Vertical - The width above and below the status bar parts Inter - The width between parts of the status bar

GetPartRect(part_index)

Return the rectangle of the part specified by part_index

GetPartText(part_index)

Return the text of the part specified by part_index

PartCount()

Return the number of parts

PartRightEdges()

Return the widths of the parts

border_widths()

Return the border widths of the StatusBar

A dictionary of the 3 available widths is returned: Horizontal - the horizontal width Vertical - The width above and below the status bar parts Inter - The width between parts of the status bar

client_rects()

Return the client rectangles for the control

controltypes = [<MagicMock name='mock.client.GetModule().UIA_StatusBarControlTypeId' id='139623341415336'>]
friendlyclassname = 'StatusBar'
get_part_rect(part_index)

Return the rectangle of the part specified by part_index

get_part_text(part_index)

Return the text of the part specified by part_index

part_count()

Return the number of parts

part_right_edges()

Return the widths of the parts

texts()

Return the texts for the control

windowclasses = ['msctls_statusbar32', '.*StatusBar', 'WindowsForms\\d*\\.msctls_statusbar32\\..*']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.TabControlWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Tab common control

GetSelectedTab()

Return the index of the selected tab

GetTabRect(tab_index)

Return the rectangle to the tab specified by tab_index

GetTabText(tab_index)

Return the text of the tab

RowCount()

Return the number of rows of tabs

Select(tab)

Select the specified tab on the tab control

TabCount()

Return the number of tabs

client_rects()

Return the client rectangles for the Tab Control

controltypes = [<MagicMock name='mock.client.GetModule().UIA_TabControlTypeId' id='139623341436544'>]
friendlyclassname = 'TabControl'
get_properties()

Return the properties of the TabControl as a Dictionary

get_selected_tab()

Return the index of the selected tab

get_tab_rect(tab_index)

Return the rectangle to the tab specified by tab_index

get_tab_text(tab_index)

Return the text of the tab

row_count()

Return the number of rows of tabs

select(tab)

Select the specified tab on the tab control

tab_count()

Return the number of tabs

texts()

Return the texts of the Tab Control

windowclasses = ['SysTabControl32', 'WindowsForms\\d*\\.SysTabControl32\\..*']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.ToolTip(ctrl, tip_index)

Bases: object

Class that Wraps a single tip from a ToolTip control

class pywinauto.controls.common_controls.ToolTipsWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows ToolTips common control (not fully implemented)

GetTip(tip_index)

Return the particular tooltip

GetTipText(tip_index)

Return the text of the tooltip

ToolCount()

Return the number of tooltips

friendlyclassname = 'ToolTips'
get_tip(tip_index)

Return the particular tooltip

get_tip_text(tip_index)

Return the text of the tooltip

texts()

Return the text of all the tooltips

tool_count()

Return the number of tooltips

windowclasses = ['tooltips_class32', '.*ToolTip', '#32774', 'MS_WINNOTE', 'VBBubble']
class pywinauto.controls.common_controls.ToolbarWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Toolbar common control

Button(button_identifier, exact=True, by_tooltip=False)

Return the button at index button_index

ButtonCount()

Return the number of buttons on the ToolBar

CheckButton(button_identifier, make_checked, exact=True)

Find where the button is and click it if it’s unchecked and vice versa

GetButton(button_index)

Return information on the Toolbar button

GetButtonRect(button_index)

Get the rectangle of a button on the toolbar

GetButtonStruct(button_index)

Return TBBUTTON structure on the Toolbar button

GetToolTipsControl()

Return the tooltip control associated with this control

MenuBarClickInput(path, app)

Select menu bar items by path (experimental!)

The path is specified by a list of items separated by ‘->’ each Item can be the zero based index of the item to return prefaced by # e.g. #1.

Example:
“#1 -> #0”, “#1->#0->#0”
PressButton(button_identifier, exact=True)

Find where the button is and click it

TipTexts()

Return the tip texts of the Toolbar (without window text)

button(button_identifier, exact=True, by_tooltip=False)

Return the button at index button_index

button_count()

Return the number of buttons on the ToolBar

check_button(button_identifier, make_checked, exact=True)

Find where the button is and click it if it’s unchecked and vice versa

friendlyclassname = 'Toolbar'
get_button(button_index)

Return information on the Toolbar button

get_button_rect(button_index)

Get the rectangle of a button on the toolbar

get_button_struct(button_index)

Return TBBUTTON structure on the Toolbar button

get_tool_tips_control()

Return the tooltip control associated with this control

menu_bar_click_input(path, app)

Select menu bar items by path (experimental!)

The path is specified by a list of items separated by ‘->’ each Item can be the zero based index of the item to return prefaced by # e.g. #1.

Example:
“#1 -> #0”, “#1->#0->#0”
press_button(button_identifier, exact=True)

Find where the button is and click it

texts()

Return the texts of the Toolbar

tip_texts()

Return the tip texts of the Toolbar (without window text)

windowclasses = ['ToolbarWindow32', 'WindowsForms\\d*\\.ToolbarWindow32\\..*', 'Afx:ToolBar:.*']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.TrackbarWrapper(element_info)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows Trackbar common control

controltypes = [<MagicMock name='mock.client.GetModule().UIA_SliderControlTypeId' id='139623340712232'>]
friendlyclassname = 'Trackbar'
get_channel_rect()

Get position of the bounding rectangle for a Trackbar

get_line_size()

Get the number of logical positions the trackbar’s slider

get_num_ticks()

Get trackbar num ticks

get_page_size()

Get the number of logical positions for the trackbar’s slider

get_position()

Get trackbar position

get_range_max()

Get max available trackbar value

get_range_min()

Get min available trackbar value

get_sel_end()

Get end of selection

get_sel_start()

Get start of selection

get_tooltips_control()

Get trackbar tooltip

set_line_size(line_size)

Set trackbar line size

set_page_size(page_size)

Set trackbar page size

set_position(pos)

Set trackbar position

set_range_max(range_max)

Set max available trackbar value

set_range_min(range_min)

Set min available trackbar value

set_sel(sel_start, sel_end)

Set start and end of selection

windowclasses = ['msctls_trackbar']
class pywinauto.controls.common_controls.TreeViewWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows TreeView common control

EnsureVisible(path)

Make sure that the TreeView item is visible

GetItem(path, exact=False)

Read the TreeView item

  • path the path to the item to return. This can be one of the following:
    • A string separated by \ characters. The first character must be \. This string is split on the \ characters and each of these is used to find the specific child at each level. The \ represents the root item - so you don’t need to specify the root itself.
    • A list/tuple of strings - The first item should be the root element.
    • A list/tuple of integers - The first item the index which root to select.
IsSelected(path)

Return True if the item is selected

Item(path, exact=False)

Read the TreeView item

  • path the path to the item to return. This can be one of the following:
    • A string separated by \ characters. The first character must be \. This string is split on the \ characters and each of these is used to find the specific child at each level. The \ represents the root item - so you don’t need to specify the root itself.
    • A list/tuple of strings - The first item should be the root element.
    • A list/tuple of integers - The first item the index which root to select.
ItemCount()

Return the count of the items in the treeview

PrintItems()

Print all items with line indents

Root()

Return the root element of the tree view

Roots()

Get root items of the control

Select(path)

Select the treeview item

controltypes = [<MagicMock name='mock.client.GetModule().UIA_TreeControlTypeId' id='139623341376848'>]
ensure_visible(path)

Make sure that the TreeView item is visible

friendlyclassname = 'TreeView'
get_item(path, exact=False)

Read the TreeView item

  • path the path to the item to return. This can be one of the following:
    • A string separated by \ characters. The first character must be \. This string is split on the \ characters and each of these is used to find the specific child at each level. The \ represents the root item - so you don’t need to specify the root itself.
    • A list/tuple of strings - The first item should be the root element.
    • A list/tuple of integers - The first item the index which root to select.
get_properties()

Get the properties for the control as a dictionary

is_selected(path)

Return True if the item is selected

item(path, exact=False)

Read the TreeView item

  • path the path to the item to return. This can be one of the following:
    • A string separated by \ characters. The first character must be \. This string is split on the \ characters and each of these is used to find the specific child at each level. The \ represents the root item - so you don’t need to specify the root itself.
    • A list/tuple of strings - The first item should be the root element.
    • A list/tuple of integers - The first item the index which root to select.
item_count()

Return the count of the items in the treeview

print_items()

Print all items with line indents

roots()

Get root items of the control

select(path)

Select the treeview item

texts()

Return all the text for the tree view

tree_root()

Return the root element of the tree view

windowclasses = ['SysTreeView32', 'WindowsForms\\d*\\.SysTreeView32\\..*', 'TTreeView', 'TreeList.TreeListCtrl']
writable_props

Extend default properties list.

class pywinauto.controls.common_controls.UpDownWrapper(hwnd)

Bases: pywinauto.controls.hwndwrapper.HwndWrapper

Class that wraps Windows UpDown common control

Decrement()

Decrement the number in the UpDown control by one

GetBase()

Get the base the UpDown control (either 10 or 16)

GetBuddyControl()

Get the buddy control of the updown control

GetRange()

Return the lower, upper range of the up down control

GetValue()

Get the current value of the UpDown control

Increment()

Increment the number in the UpDown control by one

SetBase(base_value)

Get the base the UpDown control (either 10 or 16)

SetValue(new_pos)

Set the value of the of the UpDown control to some integer value

controltypes = [<MagicMock name='mock.client.GetModule().UIA_SpinnerControlTypeId' id='139623341477672'>]
decrement()

Decrement the number in the UpDown control by one

friendlyclassname = 'UpDown'
get_base()

Get the base the UpDown control (either 10 or 16)

get_buddy_control()

Get the buddy control of the updown control

get_range()

Return the lower, upper range of the up down control

get_value()

Get the current value of the UpDown control

increment()

Increment the number in the UpDown control by one

set_base(base_value)

Get the base the UpDown control (either 10 or 16)

set_value(new_pos)

Set the value of the of the UpDown control to some integer value

windowclasses = ['msctls_updown32', 'msctls_updown']