jacexh / pyautoit

Python binding for AutoItX3.dll
MIT License
269 stars 74 forks source link

control_command command param #13

Closed jayson-panganiban closed 4 years ago

jayson-panganiban commented 8 years ago

I am not getting correct command value when using command param with control_command. Error happens when I am expecting value to be 0 or not visible.

E.g. control_visibility = autoit.control_command('win_title', 'control_id', 'IsVisible') print control_visibility

Demerso commented 5 years ago

It's probably because PyAutoIt cannot find the control. This is how I do it:

def _control_visible(title, control):
    try:
        control_is_visible = autoit.control_command(title, control, "IsVisible")
    except autoit.AutoItError:
        control_is_visible = 0
    finally:
        return bool(control_is_visible)