mwfl

A productive C++20 foundation for native Windows UI.

Real HWND controls, typed events, checked setup, and DPI-aware layout — with the Win32 escape hatch always within reach.

#include <mwfl/mwfl.h>

using mwfl::operator""_dip;

class MainWindow final : public mwfl::WindowBase {
public:
    void BuildUI() override {
        SetTitle(L"Hello, mwfl");

        mwfl::ControlHost ui{*this};
        ui.Add(message_, L"Native UI, modern C++20.");
        ui.Add(close_, L"Close");

        SetLayout(mwfl::Column()
            .Margin(24_dip).Gap(12_dip)
            .Add(message_, mwfl::Auto())
            .Add(close_, mwfl::Fixed(36_dip)));
    }

private:
    mwfl::Label message_;
    mwfl::Button close_;
};
A complete native window — no message-map macros or generated application object.
Current public preview

mwfl 0.1.0 is the first official release.

Download the tested MSVC x64 or ARM64 binary preview, or build from source.

The 0.1.0 baseline brings the complete tested UI, application-support, and Foundation component set together.

46documented capability slices
62compiled examples
C++20concepts, RAII, ranges
MITWindows 10 1809+ · x64 / ARM64
Three real native applications

From focused editor to full desktop workspace.

The same thin real-HWND foundation scales from a local-first Markdown editor to Explorer-style navigation and persistent IDE docking.

MWFL capability collage showing the Markdown Editor, Explorer, and Docking Workspace
Captured on Windows in one light theme at 100% scale. Every window is a compiled example, not a mockup.
40-second MWFL showcase covering responsive DPI-aware UI, Markdown editing and preview, Explorer workflows, docking, and file-drop integration
A 40-second tour of responsive/DPI behavior, edit and preview composition, native file workflows, docking, and desktop file-drop integration.
Choose the smallest surface

Start at the layer your application needs.

Core

Native UI fundamentals

Windows, controls, typed events, layout, DPI, timers, and safe worker handoff.

Build the first window

Application

Desktop workflows

Commands, forms, documents, dialogs, settings, persistence, and reference applications.

Build the Notepad workflow

Optional

Separately linked integrations

Direct2D/3D, WIC imaging, WebView2, and Scintilla without expanding the core dependency surface.

Choose an optional component

Modern native API

One concise path for native UI.

27 controls

Consistent creation

Bind a parent once with ControlHost; omit provisional bounds when layout owns positioning.

C++20 ranges

Checked setup

Populate controls from lists, spans, ranges, or views, then use Must for source-located failures.

Native settings

Persistent property sheets

Ship resizable pages with dirty/apply state, validation feedback, Apply/OK/Cancel, versioned per-user persistence, and a real GUI self-test.

Structured modal UI

Task dialogs

Use buttons, radios, verification, progress, links, callbacks, safe cancellation, and explicit HRESULT results.

Desktop composition

Custom dialogs and tray apps

Own modal/modeless forms with retained layout, or build stable-GUID notification-area utilities that recover after Explorer restarts.

Reference shell

Explorer-style application

Compose Rebar, Toolbar, Tabs, Splitter, stable TreeView, virtual ListView, StatusBar, image lists, accelerators, and context menus.

Optional WebView2

Native browser host

Use a pinned SDK with structured Runtime discovery, async creation, offline tests, accelerator routing, and process recovery.

Build the browser

Optional Scintilla

Source-code editor

Deploy a pinned runtime with strict Unicode, UTF-8 positions, typed notifications, search/replace, and save points.

Build the editor

Optional Windows UI

Ribbon and legacy MDI

Use generated Ribbon resources or a bounded MDI compatibility layer with stable IDs, explicit ownership, and deterministic teardown.

Explore traditional integrations

Optional interop

Graphics, taskbar, and Help

Record EMF, export bounded GDI+ PNGs, recover taskbar commands, and launch validated contextual Help.

Follow the safe integration guide

One expression

Native HWND layout

Pass nested rvalue rows, columns, and overlays directly to window-owned SetLayout.

No macros

Typed events

Override only the keyboard, mouse, resize, timer, DPI, command, or paint events the window needs.

Real Win32

Nothing hidden

Native handles, messages, styles, and return values stay reachable through GetHwnd().

Per-Monitor V2

DPI-aware by default

DIP units, per-monitor scaling, and a shared manifest across every example target.

Responsive layout

Resize real controls.

Layout nodes keep non-owning HWND references and rearrange automatically on WM_SIZE.

using mwfl::operator""_dip;

SetLayout(
    mwfl::Row()
        .Gap(8_dip)
        .Add(name_, mwfl::Stretch(1.0f, 160_dip))
        .Add(save_, mwfl::Fixed(96_dip)));
Typed events

Match controls, not IDs.

Command events identify the originating control without message-map macros or manual HWND comparisons.

mwfl::EventResult OnCommand(const mwfl::CommandEvent& event) override {
    if (event.IsClicked(greet_)) {
        status_.SetText(L"Hello, " + name_.GetText());
        return mwfl::EventResult::Handled();
    }
    return mwfl::EventResult::Propagate();
}
Applications and examples

Real native UI, ready to explore.

Eight public standalone applications show how MWFL behaves beyond a control gallery. Each application card opens a detailed design, safety, build, and testing overview before linking to its source.

Search all 46 public capabilities and 62 runnable examples

Public-preview scope

A tested baseline, with explicit boundaries.

Binary release

x64 and ARM64 packages

The v0.1.0 downloadable binaries cover MSVC x64 and ARM64, with checksums and build-provenance attestations.

Core stays small

Optional means optional

WebView2, Scintilla, Direct2D/3D, WIC, Ribbon, MDI, printing, OLE, Shell, and graphics integrations are requested and linked separately.

0.1.0 contract

Official source baseline

The stable source surface is documented and tested. Applications rebuild mwfl with the same supported MSVC toolset rather than relying on a cross-toolset ABI.

NativeReal HWND controls and Win32 messages
ModernC++20 concepts, RAII, typed events, checked batches
ResponsiveDPI-aware row, column, and overlay layout

Start with one CMake block.

FetchContent pulls mwfl and its pinned WIL dependency — no manual paths.