Pywinauto is a set of Python modules for automating the Microsoft Windows GUI. It enables interaction with native Windows applications, supporting both Win32 API (default) and UI Automation (UIA) backends. The current version is 0.6.9, and the library maintains an active release cadence with regular bug fixes and enhancements.
pip install pywinautoVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to launch Notepad, interact with its menus, close a dialog, and type text into its main edit control using `pywinauto`.
Ensure your project is running on Python 3.x if you plan to upgrade pywinauto beyond version 0.6.9.
Specify the backend explicitly when initializing `Application`: `app = Application(backend='uia').start('your_app.exe')` or `Desktop(backend='uia').windows()`.Run your Python script with the same or higher administrative privileges as the target application.
Use `window.print_control_identifiers()` to get a detailed list of available controls and their properties. Use explicit `child_window` arguments like `child_window(title='...', class_name='...', control_type='...')` for robust identification. Since 0.6.5, `auto_id` and `control_type` properties are available for Win32 backend.
If `type_keys` fails to input text, try setting `vk_packet=False`: `control.type_keys('text', vk_packet=False)`.