Win Automation Tool
This project contains a Python module win32_gui_utils that provides utilities for interacting with Windows GUI elements using the win32 API.
Features
- Find windows by name
- Get handles for controls within windows
- Simulate mouse clicks (left and right)
- Retrieve and set text in controls
- Wait for controls to be ready for interaction
- Get properties of controls within a window
- Select items in ComboBoxes
- Focus windows
Dependencies
- pywin32: Provides access to Windows APIs (win32gui, win32con, win32api)
- time, ctypes: Standard Python modules for time control and buffer manipulation
Usage
Here's a basic example of how to use some of the functions:
import win32_gui_utils as wgu
# Find a window
window_handle = wgu.find_window("Notepad")
# Get a control within the window
edit_handle = wgu.get_handle_by_id(window_handle, 15)
# Write text to the control
wgu.write_text(edit_handle, "Hello, World!")
# Click a button
button_handle = wgu.get_handle_by_id(window_handle, 1)
wgu.click_button(button_handle)
Main Functions
find_window(window_name, max_attempts=3, wait_time=2): Locates a window by its name (title)get_handle_by_id(hwnd, target_id): Gets the handle of a control specified by ID within a windowwait_for_control(hwnd, target_id, timeout=10, poll_interval=0.5): Waits for a control to be ready for interactionclick_button(hex_handle): Simulates a mouse click on a controlwrite_text(hex_handle, text): Sends a text string to a controlget_control_properties(parent_handle): Collects properties of child controls of a specified windowselect_combo_item(combo_hwnd, index): Selects an item in a ComboBox by indexfocus_window(hwnd): Sets a window as active (focused)
For more detailed information about each function, please refer to the docstrings in the source code.
Note
This module is designed for Windows automation tasks and requires appropriate permissions to interact with system windows and controls. Use responsibly and ensure you have the necessary rights to automate the target applications.
Metadata
Release files for win32-gui-utils 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| win32_gui_utils-0.0.3.tar.gz | 7.2 kB | Without provenance | Details for win32_gui_utils-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| win32_gui_utils-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for win32_gui_utils-0.0.3-py3-none-any.whl |
Total release size: 14.7 kB
Release files / win32_gui_utils-0.0.3.tar.gz
| Download URL | win32_gui_utils-0.0.3.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2954e5b03e0c2fa8d7a48225856597230beb8dd9b2f824ef9ae124571ff1f1ee
|
|
BLAKE2b-256 checksum How to use checksums |
7f0aa3cbe5bf2b320db6d4aa5c338279219f62c5ca448b74d412f44c16ec2f1c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Release files / win32_gui_utils-0.0.3-py3-none-any.whl
| Download URL | win32_gui_utils-0.0.3-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
845d56adb503d14ae7e2ca05f16c74fda933e53c9b50e57ab05a8e1004b228b3
|
|
BLAKE2b-256 checksum How to use checksums |
d2caba64c7c89a019fb87879891b265304528b434ec20a58547c2323f7f68d1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.6
|
Security for win32-gui-utils 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.