Uma biblioteca para automação de controles GUI.
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file win32_gui_utils-0.0.3.tar.gz.
File metadata
- Download URL: win32_gui_utils-0.0.3.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2954e5b03e0c2fa8d7a48225856597230beb8dd9b2f824ef9ae124571ff1f1ee
|
|
| MD5 |
e4a6709f6219cdcf65bb9498e824ecf6
|
|
| BLAKE2b-256 |
7f0aa3cbe5bf2b320db6d4aa5c338279219f62c5ca448b74d412f44c16ec2f1c
|
File details
Details for the file win32_gui_utils-0.0.3-py3-none-any.whl.
File metadata
- Download URL: win32_gui_utils-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
845d56adb503d14ae7e2ca05f16c74fda933e53c9b50e57ab05a8e1004b228b3
|
|
| MD5 |
d5533e73233a5da3ca8f29bbd2414ad0
|
|
| BLAKE2b-256 |
d2caba64c7c89a019fb87879891b265304528b434ec20a58547c2323f7f68d1d
|