DEV Community

Divyanshu Sinha
Divyanshu Sinha

Posted on

Introducing WinGUI — a Native Windows GUI Framework for Python

Introducing WinGUI

WinGUI is a lightweight native Windows GUI framework for Python, designed for developers who want direct access to Win32 functionality without depending on heavyweight GUI runtimes or external rendering engines.

Built with:

  • Python
  • x86-64 Assembly
  • Win32 API
  • ctypes

Unlike traditional Python GUI frameworks, WinGUI uses a custom NASM-powered native backend where all GUI logic executes directly through the Windows API.

Python acts purely as the interface layer.


Features

  • Pure Win32 — no third-party GUI runtime required
  • NASM x86-64 Assembly core
  • Modern native Windows UI
  • Full Unicode support (UTF-8 → UTF-16LE)
  • DPI-aware rendering
  • Zero external Python dependencies
  • OOP and flat-function APIs
  • Context manager support
  • Decorator-based event system
  • Multiple handlers per control

Architecture

Python Script
    │
    │  ctypes (ABI-safe bridge)
    ▼
wingui.py
    │
    │  LoadLibrary / native bindings
    ▼
wingui32.dll  (NASM x86-64 Assembly)
    │
    │  Direct Win32 API calls
    ▼
user32.dll · kernel32.dll · gdi32.dll · comctl32.dll
Enter fullscreen mode Exit fullscreen mode

Why WinGUI?

Modern desktop frameworks often introduce:

  • heavy runtimes
  • abstraction layers
  • browser engines
  • complex dependencies

WinGUI focuses on:

  • native execution
  • low overhead
  • direct OS interaction
  • predictable Win32 behavior
  • minimal architecture

The framework is intended for developers who prefer working closer to the operating system while remaining inside the Python ecosystem.


Example

from wingui import WinGUI

with WinGUI() as gui:
    hwnd = gui.create_window(640, 360, "WinGUI")

    gui.create_button(
        hwnd,
        20, 20,
        140, 40,
        "Click Me",
        control_id=1
    )

    @gui.on_command(control_id=1)
    def on_click(hwnd, ctrl_id, notif, ctrl_hwnd):
        gui.show_message_box(
            "Native Win32 GUI from Python",
            "WinGUI"
        )

    gui.run_message_loop()
Enter fullscreen mode Exit fullscreen mode

Installation

pip install wingui
Enter fullscreen mode Exit fullscreen mode

Verify installation:

python -m wingui --check
Enter fullscreen mode Exit fullscreen mode

Requirements

Component Version
Windows 10 / 11
Python 3.10+ (64-bit)
NASM 2.15+
GCC / MSVC Supported

Open Source

GitHub:
https://github.com/DivyanshuSinha136/WinGUI/

PyPI:
https://pypi.org/project/wingui/1.0.0/

Feedback, contributions, testing, and low-level discussions are welcome.

Top comments (0)