pyWinAuto: pywinauto.controls.win32_controls.ButtonWrapper -- Wrap a windows Button control

ButtonWrapper

Wrap a windows Button control


Attributes

a handle

None

a windowclasses

['Button', 'WindowsForms\\d*\\.BUTTON\\..*', 'TButton']

a friendlyclassname

'Button'

Methods

f __init__(self, hwnd) ...

Initialize the control

f FriendlyClassName(self) ...

Return the friendly class name of the button

Windows controls with the class "Button" can look like different controls based on their style. They can look like the following controls:

  • Buttons, this method returns "Button"
  • CheckBoxes, this method returns "CheckBox"
  • RadioButtons, this method returns "RadioButton"
  • GroupBoxes, this method returns "GroupBox"

f GetCheckState(self) ...

Return the check state of the checkbox

The check state is represented by an integer 0 - unchecked 1 - checked 2 - indeterminate

The following constants are defined in the win32defines module BST_UNCHECKED = 0 BST_CHECKED = 1 BST_INDETERMINATE = 2

f Check(self) ...

Check a checkbox

f UnCheck(self) ...

Uncheck a checkbox

f SetCheckIndeterminate(self) ...

Set the checkbox to indeterminate

f IsDialog(self) ...

Buttons are never dialogs so return False

f Click(self) ...

Click the Button control

f __eq__(self, other) ...

Returns True if the handles of both controls are the same

See the source for more information.