Skip to content

Releases: pywinauto/pywinauto

Minor Enhancements and Fixes

27 Oct 20:47
ff95296
Compare
Choose a tag to compare

Enhancements

  • Add allow_magic_lookup flag for Application and Desktop object. Thanks @pakal!
  • Don't duplicate already pressed key in internal list in win32_hooks.py. Thanks @TomRobo237!
  • Allow finding an edit box by title (its editable text).
  • Add option to send keyboard input for an application which doesn't handle VK_PACKET properly.
    Use vk_packet=False in method type_keys, default value is vk_packet=True. Thanks @philmbailey!

Bug Fixes

Bug Fixes

06 Jul 19:53
85eb121
Compare
Choose a tag to compare

Enhancements

  • Reuse ctypes.wintypes more to avoid redundant definitions for Win32 API.
  • Add method EditWrapper.is_editable() for "uia" backend.

Bug Fixes

  • Fix corner case with int/long conversion crash while getting text.
  • Fix UIA crash: handle InvalidControlType properly.
  • Fix menu_select() for one level main menu in WinForms apps.
  • Make Application object non-iterable (iterating was hang).
  • Fix type conversion crash in GetWindowRect (method .rectangle()).
  • Fix combo box fluttering/blinking in dump_tree() / print_control_identifiers().

Better WinForms/Qt5 Support

03 Mar 22:35
7c93b2d
Compare
Choose a tag to compare

Enhancements

  • Improve support for WinForms and Qt5: ComboBox, ListBox, DataGrid/Table.
  • Add an ability to use MFC toolbar buttons by text. Thanks @Nebyt !
  • Make method kill() hard (and fast) by default (can be used with param soft=True optionally).
  • Make visible_only=False a default option for method connect() (useful for minimized apps).
  • Add an ability to hold or release a key with params down and up for .type_keys() method. See the improved docs for keyboard module for more details. Thanks @badari412 !
  • Add method windows() to class Desktop.
  • Add Remote Execution Guide with all known RDP/VNC/psexec/etc tricks.

Bug Fixes

  • Fix UnicodeDecodeError/UnicodeEncodeError in several cases
    while printing wrapper object representation.
  • Add static text to a list of best match names for backend="uia".
  • Fix COMError for runtime_id property.
  • Fix method click() for some radio buttons.
  • Improve error message when screen is locked.
  • Use utf-8 encoding while writing dump_tree() output to file.
  • Remove few incorrect warnings for backend="win32".
  • Fix crash in GetWindowRect call.
  • Fix black screenshot issue with second monitor. Thanks @Nebyt !

Handling Privileges, AutomationID for Win32 etc.

30 Jul 08:24
960682d
Compare
Choose a tag to compare

Enhancements:

  • Check admin privileges for both target app and Python process. This
    allows detecting cases when window messages won't work.
  • Add automation_id and control_type properties
    for "win32" backend (the most useful for WinForms). Correct
    child_window() keywords are auto_id and control_type.
  • Switch pypiwin32 dependency to pywin32 which became official again.
  • New generators iter_children() and iter_descendants().
  • Add method is_checked() to "win32" check box.

Bug Fixes:

  • Method Application().connect(...) works better with timeout
    argument.
  • Fix .set_focus() for "uia" backend including minimized window case
    (issue #443).
  • maximize()/minimize() methods can be chained now.
  • Fix passing keyword arguments to a function for decorators
    @always_wait_until_passes and @always_wait_until.
  • Use correct types conversion for WaitGuiThreadIdle (issue #497).
  • Fix reporting code coverage on Linux.
  • Use .format() for logging BaseWrapper actions (issue #471).
  • Print warning in case binary type is not determined (issue #387).

UIA crash fix, multi-threading mode etc.

21 Jan 18:21
fd27458
Compare
Choose a tag to compare

Bug Fixes

  • Final fix for ValueError: NULL COM pointer access (UIA backend).

Enhancements

  • Multi-threading mode (MTA) for comtypes is enabled by default, if it's not initialized
    by another library before importing pywinauto.

  • Method get_value() has been added to EditWrapper in UIA backend.

  • Method scroll() has been added for all UIA controls which have ScrollPattern implemented.

  • Added methods is_minimized/is_maximized/is_normal/get_show_state for UIAWrapper.

  • Added handling in-place controls inside ListView control and (row, column) indexing
    in a grid-like table mode. Examples:

        auto_detected_ctrl = list_view.get_item(0).inplace_control()
    
        combo = list_view.get_item(1,1).inplace_control("ComboBox")
        combo.select("Item name")
    
        edit = list_view.get_item(3,4).inplace_control("Edit")
        edit.type_keys("some text{ENTER}", set_foreground=False)
    
        dt_picker = list_view.get_item(2,0).inplace_control("DateTimePicker")

GitHub downloads

Better stability, usability and performance

03 Jul 21:02
Compare
Choose a tag to compare
  • Improved string representation for all wrapper objects. Thanks @airelil!
  • Fixed several sporadic crashes for backend="uia".
  • Fixed several bugs in wait/wait_not methods:
    • Method wait('exists') doesn't work for backend="uia". Thanks @maollm!
    • Methods wait/wait_not take ~ default time (5 sec.) instead of customized timeout like 1 sec.
  • depth param can used in a WindowSpecification now. depth=1 means this control,
    depth=2 means immediate children only and so on (aligned with print_control_identifiers method). Thanks @dmitrykazanbaev!
  • Significantly improved sending keys to an inactive window silently. Special thanks for @antonlarin! Now 2 methods are available:
    • send_chars is supposed to send character input (this includes {Enter}, {Tab}, {Backspace}) without Alt/Shift/Ctrl modifiers.
    • send_keystrokes is for key input (including key combinations with Alt/Shift/Ctrl modifiers).
  • Method Application().connect(path='your.exe') uses default timeout Timings.app_connect_timeout.
    It can accept timeout and retry_interval keyword arguments. Thanks @daniil-kukushkin!
  • Method print_control_identifiers is more consistent and minimum 2x faster now! Thanks @cetygamer!
  • Fixed subclassing Application with your own methods. Thanks @efremovd!
  • Param work_dir can be used in Application().start(...). Thanks @efremovd!
  • Class Application has been enriched with methods is_process_running() and wait_for_process_exit(). Thanks @efremovd!
  • Module timings uses time.clock() for Python 2.x and time.perf_counter() for Python 3.x
    so that accident system time change can't affect on your script behavior. Thanks @airelil!
  • Added WireShark example. Thanks @ViktorRoy94!
  • Now print_control_identifiers() can dump UI elements tree to a file. Thanks @sovrasov!
  • Improved logging actions for backend="uia", extended example for MS Paint. Thanks @ArtemSkrebkov!
  • Extended CalendarWrapper for backend="win32" with these methods: get_month_delta,
    set_month_delta and get_month_range. Thanks @Nikita-K!
  • Added method legacy_properties() to UIAWrapper. Thanks @AsyaPronina!
  • Improved VB6 ListView detection for backend="win32". Thanks @KirillMoizik!
  • Fixed 64-bit specific bug in TreeViewWrapper for backend="win32"
    (argument 4: <type 'exceptions.OverflowError'>: long int too long to convert).

GitHub downloads

More bug fixes

28 Feb 12:57
Compare
Choose a tag to compare
  • Several bugs were fixed:
    • Maximized window is always resized (restored) when calling set_focus().
    • AttributeError: type object '_CustomLogger' has no attribute 'disable'.
    • print_control_identifiers() gets bytes string on Python 3.x.
    • Importing pywinauto causes debug messages to appear twice.
  • Improved click methods behaviour for Win32 ListView and TreeView:
    ensure_visible() is called inside before the click.
  • Made taskbar.SystemTrayIcons localization friendly.

GitHub downloads

Bug fixes and optimizations for UI Automation and beyond

08 Feb 19:40
Compare
Choose a tag to compare
  • win32_hooks module is well tested and more reliable now. See detailed example.
  • Fixed several bugs and crashes here and there.
    • Crash when ctrl.window_text() becomes None at the right moment. Thanks @mborus!
    • HwndWrapper.set_focus() fails when used via interpreter. Thanks @mtkennerly!
    • Fix LoadLibrary call error on just released Python 2.7.13. Thanks @KirillMoizik!
    • AttributeError: WindowSpecification class has no 'CPUUsage' method.
    • comtypes prints a lot of warnings at import pywinauto.
    • Methods is_dialog() and restore() are missed for UIA backend.
    • Method print_control_identifiers() crashes on some applications with Unicode symbols.
    • Installation by python setup.py install may fail if pyWin32 dependency was installed manually.
    • Bug in resolving attributes: 'UIAWrapper' object has no attribute 'Menu' for dlg = app.Custom.Menu.
    • Method send_chars() can now send {ENTER} to some applications. Thanks @batterseapower!
  • Searching UI elements is faster now especially if you use control_type or auto_id in
    a WindowSpecification. Method Application.kill() is also optimized in many cases.
  • Added an example for Win10 Calculator.

GitHub downloads

MS UI Automation support, PEP-8 compliance, Win32 hooks and more

31 Oct 20:38
Compare
Choose a tag to compare
  • This big release introduces MS UI Automation (UIA) support (beta). Feedback is very welcome!
    • Just start from app = Application(backend='uia').start('your_app.exe').
    • Default backend is still 'win32' if nothing is specified.
    • Supported WPF controls: Menu, Button/CheckBox/RadioButton, ComboBox, Edit,
      Tab control, List (ListView), DataGrid, Tree, Toolbar, Tooltip, Slider.
    • It uses native UIAutomationCore.dll through comtypes (like UiaComWrapper for .NET but in CPython).
    • Despite code coverage is ~95% consider it as beta quality. Performance is slower than for "win32".
  • Documentation is built continuously now on ReadTheDocs. See also improved
    Getting Started Guide.
  • Modules keyboard and mouse can be used out of any window context now. And they work on Linux as well!
  • New multi-backend architecture makes implementation of new platforms support
    easier in the future. The minimal set for new backend includes its name and
    two classes inherited from ElementInfo and from BaseWrapper. New backend
    must be registered by function backend.register(). Linux AT SPI and Apple Accessibility API are in the long term plans.
  • Code style is much closer to PEP8: i.e. click_input should be used
    instead of ClickInput.
  • Initial implementation of the win32_hooks module. Keyboard and mouse event
    handlers can be registered in the system. It was inspired by pyHook, pyhk,
    pyhooked and similar modules, but re-written from scratch. Thanks for
    Max Samokhvalov! The fork (at some moment) of the win32_hooks module is
    used in pyhooked 0.8 by Ethan Smith.
  • A lot of small improvements are not counted here.

GitHub downloads

Bug fixes and partial MFC Menu Bar support

30 Oct 14:24
Compare
Choose a tag to compare
  • Fix bugs and inconsistencies:
    • Add where="check" possible value to the ListViewWrapper.Click/ClickInput` methods.
    • Add CheckByClickInput and UncheckByClickInput methods for a plain check box.
    • Fix crash while waiting for the window start.
  • Add partial MFC Menu Bar support. The menu bar can be interpreted as a toolbar. Items are clickable by index through experimental MenuBarClickInput method of the ToolbarWrapper.
  • Python 3.5 is supported.

GitHub downloads