Native capabilities, without burdening the core.
Ribbon, legacy MDI, graphics, printing, OLE, Shell, WebView2, and Scintilla are isolated CMake components. Enable only what an application needs, retain native ownership and escape hatches, and run deterministic local tests.
Windows Ribbon and legacy MDI
mwfl::ribbon maps stable command IDs, modes, contextual tabs, and copied recent-item metadata onto a generated UICC resource. mwfl::mdi offers a bounded compatibility path for traditional MDI products while keeping documents and views application-owned. New applications should prefer the modern document and docking workspaces.
find_package(mwfl CONFIG REQUIRED COMPONENTS ribbon mdi)
target_link_libraries(ribbon_app PRIVATE mwfl::ribbon)
target_link_libraries(legacy_mdi_app PRIVATE mwfl::mdi)
MdiChildId values, and collect every dirty-close decision before closing any child.Build the Ribbon reference step by step →
Build the MDI reference step by step →
EMF, GDI+, taskbar commands, and contextual Help
mwfl::graphics provides move-only enhanced-metafile ownership, callback-scoped recording/playback, explicit GDI+ startup, and bounded atomic PNG export. mwfl::shell adds stable thumbnail commands and tab state that can be reapplied when TaskbarCreated reports an Explorer restart. HelpRequest accepts validated local CHM/HTML files or HTTPS targets and supports injected offline test backends.
find_package(mwfl CONFIG REQUIRED COMPONENTS graphics shell)
target_link_libraries(diagram_app PRIVATE mwfl::graphics mwfl::shell)
Gdiplus::Graphics values are borrowed. Pixel counts are bounded, HWND/HICON values stay borrowed, Help never constructs a shell command, and tests never require a browser or network.Printing, OLE drag/drop, and Shell integration
mwfl::printing shares printer-independent pagination between preview and safe native print transactions. mwfl::ole supplies bounded Unicode, file-list, custom, and delayed COM data plus revoke-once drop registration. mwfl::shell supplies versioned settings, reversible per-user associations, Jump Lists, recent documents, and recoverable taskbar state.
find_package(mwfl CONFIG REQUIRED COMPONENTS printing ole shell)
target_link_libraries(print_view PRIVATE mwfl::printing)
target_link_libraries(drop_window PRIVATE mwfl::ole)
target_link_libraries(shell_window PRIVATE mwfl::shell)
WebView2 Browser
The mwfl::webview2 target pins the official SDK and x64 static loader. WebView2Host reports an absent Evergreen Runtime as structured state, creates its environment and controller asynchronously in the application STA, resizes and transfers focus, routes accelerators, reports navigation, recovers failed processes, and closes deterministically.
cmake --preset vs2026-x64-webview2
cmake --build --preset vs2026-x64-webview2-debug --target mwfl_browser_demo
./build/presets/vs2026-x64-webview2/examples/browser/Debug/mwfl_browser_demo.exe
find_package(mwfl CONFIG REQUIRED COMPONENTS webview2)
target_link_libraries(my_browser PRIVATE mwfl::webview2)
Scintilla Code Editor
The mwfl::scintilla target pins official Scintilla 5.6.5 source and x64 runtime archives. The wrapper uses strict UTF-16/UTF-8 conversion, defines positions as UTF-8 bytes, decodes typed notifications, and exposes commands, search/replace, save points, zoom, and a raw pinned-API escape hatch.
cmake --preset vs2026-x64-scintilla
cmake --build --preset vs2026-x64-scintilla-debug --target mwfl_code_editor_demo
./build/presets/vs2026-x64-scintilla/examples/code_editor/Debug/mwfl_code_editor_demo.exe
find_package(mwfl CONFIG REQUIRED COMPONENTS scintilla)
target_link_libraries(my_editor PRIVATE mwfl::scintilla)
mwfl_deploy_scintilla(my_editor)
Scintilla.dll beside the executable. Missing and wrong-architecture runtimes are structured diagnostics.Ownership rules
- All native hosts stay on their creating UI thread; Ribbon and WebView2 initialization require an STA.
- The hosts own only the native resources documented by their component. Raw COM interfaces, HWND/HICON values, callback drawing contexts, and notification payloads are borrowed.
- Destroy optional hosts in reverse order before owner HWND or COM teardown. Post out of reentrant callbacks before restarting or closing native state.
- Core
mwfl::uiconsumers do not link, download, initialize, or deploy any optional component.