Skip to main content

Windows window coverage and foreground helper via ctypes

Project description

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

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

overlapping_windows-3.0.0.tar.gz (107.8 kB view details)

Uploaded Source

Built Distribution

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

overlapping_windows-3.0.0-py3-none-any.whl (106.3 kB view details)

Uploaded Python 3

File details

Details for the file overlapping_windows-3.0.0.tar.gz.

File metadata

  • Download URL: overlapping_windows-3.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

Hashes for overlapping_windows-3.0.0.tar.gz
Algorithm Hash digest
SHA256 acf9a9e124ee04aac5db847e33c3e35d897cd0c4ceedbbe3a9fa743b7a634779
MD5 572a5dd5536622c22e0ef0636e875c86
BLAKE2b-256 bdfc0413ce481c887b1133e8b2d1e4a3ac9f6441349d7c86479d86a75df17636

See more details on using hashes here.

File details

Details for the file overlapping_windows-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for overlapping_windows-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 770cea4f802580eb5d2754f6fb4787f5a031a6db6ad43d3aea7c43ae76506e90
MD5 8e56a9a0df7f5ea2a700b71e6e1cdcda
BLAKE2b-256 dbf80268d1faa6d9b777a03113f03cd9072f782f02dc03c3e3bb8d3edd3c63d9

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