Windows window coverage and foreground helper via ctypes
Project description
overlap
by Qarvexium
Lightweight Windows ctypes wrapper for window visibility, coverage detection, and foreground window tracking.
Overview
overlap provides fast access to native Windows window state information through a minimal ctypes wrapper around a bundled DLL.
It is designed for:
- desktop overlays
- window management tools
- UI automation
- visibility / focus tracking systems
No network access. No background services. Pure native calls.
Features
- Get current foreground window (HWND)
- Detect window coverage state
- Check foreground ownership
- Human-readable coverage conversion
- Lightweight DLL-based backend
Installation
pip install overlap
Quick Start
from overlap import *
hwnd = get_foreground_window()
state = check_window_coverage(hwnd)
print(state, coverage_text(state))
API Reference
get_foreground_window()
Returns the handle of the currently active foreground window.
Returns:
int (HWND)
check_window_coverage(hwnd)
Checks how visible a window is using the native DLL.
Returns:
| Code | Meaning |
|---|---|
| -1 | Invalid Window |
| 0 | Fully Covered |
| 1 | Partly Covered |
| 2 | Barely Covered |
| 3 | Fully Visible |
is_foreground_mine(hwnd)
Checks whether a window belongs to the foreground context (based on DLL logic).
Returns:
bool
coverage_text(code)
Converts coverage codes into readable text.
coverage_text(3) # Fully Visible
How It Works
The library automatically loads the correct native DLL:
ol_x64.dll(64-bit systems)ol_x86.dll(32-bit systems)
It acts as a thin wrapper around an custom made ol_x64/86.dll overlap_x64/86.dll
Use Cases
- Window visibility tracking
- Desktop overlays
- Automation tools
- Focus-aware applications
- Screen state monitoring
(Y:Yes,N:No)
Platform Support
| OS | Supported |
|---|---|
| Windows | Y |
| Linux | N |
| macOS | N |
License
MIT License
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 overlapping_windows-2.0.0.tar.gz.
File metadata
- Download URL: overlapping_windows-2.0.0.tar.gz
- Upload date:
- Size: 107.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71852171f80c01970228885cf19cbaea95b582dee54e2c3a0298e06a42030175
|
|
| MD5 |
fb14f44b32975e78be227ccdd9f2d5f9
|
|
| BLAKE2b-256 |
4ffe30e2562708ce04c897e6d05481f62c128c0c14d92a013769f2739b31d823
|
File details
Details for the file overlapping_windows-2.0.0-py3-none-any.whl.
File metadata
- Download URL: overlapping_windows-2.0.0-py3-none-any.whl
- Upload date:
- Size: 106.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0236811f7195984f4b560643340c5a12d6c4127a324329704821b56874fd0ee
|
|
| MD5 |
b60def75ef5a50b9c79da71449da00f9
|
|
| BLAKE2b-256 |
cd29a4ce6b70ca1f24bc32016da9c74ebace91785bf0e0599d07bdd3c70e9049
|