Skip to main content

overlap

by Qarvexium

Python Platform License Status

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 overlapping_windows

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

Release files for overlapping-windows 3.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for overlapping-windows 3.0.0
File Size Uploaded
overlapping_windows-3.0.0.tar.gz 107.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for overlapping-windows 3.0.0
File Interpreter ABI Platform
overlapping_windows-3.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 214.1 kB

Release files / overlapping_windows-3.0.0.tar.gz

Download URL overlapping_windows-3.0.0.tar.gz
Size 107.8 kB
Tags Source
SHA-256 checksum
How to use checksums
acf9a9e124ee04aac5db847e33c3e35d897cd0c4ceedbbe3a9fa743b7a634779
BLAKE2b-256 checksum
How to use checksums
bdfc0413ce481c887b1133e8b2d1e4a3ac9f6441349d7c86479d86a75df17636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release files / overlapping_windows-3.0.0-py3-none-any.whl

Download URL overlapping_windows-3.0.0-py3-none-any.whl
Size 106.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
770cea4f802580eb5d2754f6fb4787f5a031a6db6ad43d3aea7c43ae76506e90
BLAKE2b-256 checksum
How to use checksums
dbf80268d1faa6d9b777a03113f03cd9072f782f02dc03c3e3bb8d3edd3c63d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.11

Release history Release notifications | RSS feed

This release

3.0.0 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page