Metadata-Version: 2.4
Name: overlapping-windows
Version: 3.0.0
Summary: Windows window coverage and foreground helper via ctypes
Author: Qarvexium
License: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: Microsoft :: Windows
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# overlap
by Qarvexium
---

![Python](https://img.shields.io/badge/python-3.8+-blue.svg)
![Platform](https://img.shields.io/badge/platform-windows-lightgrey.svg)
![License](https://img.shields.io/badge/license-MIT-green.svg)
![Status](https://img.shields.io/badge/status-stable-brightgreen.svg)

**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

```bash
pip install overlapping_windows
```

---

## Quick Start

```python
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.

```python
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
