Skip to main content

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 window
  • wait_for_control(hwnd, target_id, timeout=10, poll_interval=0.5): Waits for a control to be ready for interaction
  • click_button(hex_handle): Simulates a mouse click on a control
  • write_text(hex_handle, text): Sends a text string to a control
  • get_control_properties(parent_handle): Collects properties of child controls of a specified window
  • select_combo_item(combo_hwnd, index): Selects an item in a ComboBox by index
  • focus_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

win32_gui_utils-0.0.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

win32_gui_utils-0.0.3-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

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

Hashes for win32_gui_utils-0.0.3.tar.gz
Algorithm Hash digest
SHA256 2954e5b03e0c2fa8d7a48225856597230beb8dd9b2f824ef9ae124571ff1f1ee
MD5 e4a6709f6219cdcf65bb9498e824ecf6
BLAKE2b-256 7f0aa3cbe5bf2b320db6d4aa5c338279219f62c5ca448b74d412f44c16ec2f1c

See more details on using hashes here.

File details

Details for the file win32_gui_utils-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for win32_gui_utils-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 845d56adb503d14ae7e2ca05f16c74fda933e53c9b50e57ab05a8e1004b228b3
MD5 d5533e73233a5da3ca8f29bbd2414ad0
BLAKE2b-256 d2caba64c7c89a019fb87879891b265304528b434ec20a58547c2323f7f68d1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page