
Label
ui.Add(label_, L"Status");Controls exampleEvery wrapper owns or observes a real Windows object. The concise path is shown first; native handles, messages, styles, and return values remain available.
Creates the stack-owned main window, runs the message loop, and guarantees cleanup.
int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int show) {
return mwfl::RunApplication<MainWindow>(instance, show);
}
wWinMain.Derive from WindowBase and override only the typed events the application needs.
class MainWindow final : public mwfl::WindowBase {
public:
void BuildUI() override {
SetTitle(L"My app");
}
mwfl::EventResult OnKeyDown(const mwfl::KeyEvent& event) override {
if (event.virtual_key == VK_ESCAPE) Close();
return mwfl::EventResult::Handled();
}
};

A move-only RAII timer with chrono intervals and typed IDs.
heartbeat_.Start(*this, {1}, 1s);
mwfl::EventResult OnTimer(mwfl::TimerId id) override {
status_.SetText(L"Tick");
return mwfl::EventResult::Handled();
}Owned native menus and accelerators, custom modal/modeless forms, system file/folder dialogs, Unicode clipboard, shell drops, persistent placement, DPI fonts, and focus navigation.
mwfl::Menu bar, file;
bar.Create();
file.CreatePopup();
file.AppendCommand(100, L"Open\tCtrl+O");
bar.AppendSubmenu(std::move(file), L"File");
bar.AttachToWindow(GetHwnd());
const auto picked = mwfl::ShowOpenFileDialog({.owner = GetHwnd()});
if (picked.accepted) Open(picked.path);
mwfl::Dialog form({.owner = GetHwnd(), .title = L"Profile"});
const auto result = form.ShowModal();A complete notification-area utility with stable-GUID tray lifetime, typed context commands, notifications, Explorer restart recovery, and topology-aware outer corners across the virtual desktop.
EnumDisplayMonitors(nullptr, nullptr, CollectMonitor, data);
GetCursorPos(&cursor);
const auto hit = hot_corners::Detect(cursor, monitors, 2);
const auto fired = dwell.Update(hit, GetTickCount64(), 350);
if (fired) Activate(*fired);
if (tray_.IsTaskbarCreated(message)) tray_.Recreate();
else if (auto event = tray_.Decode(message)) RouteTray(*event);

A complete native composition: Rebar and image-backed Toolbar, stable Tabs, keyboard Splitter, TreeView navigation, owner-data ListView, responsive StatusBar, accelerators, and context commands.
mwfl::ControlHost panes{splitter_};
panes.Add(tree_, {204}, {});
panes.Add(list_, {205}, {},
mwfl::ListViewOptions{.virtual_data = true});
splitter_.AttachPanes(tree_.GetHwnd(), list_.GetHwnd());
list_.SetVirtualModel(model_);
SetLayout(mwfl::Column()
.Add(rebar_, mwfl::Auto())
.Add(tabs_, mwfl::Fixed(34.0_dip))
.Add(splitter_, mwfl::Stretch())
.Add(status_, mwfl::Auto()));Label, Button, TextBox, CheckBox, RadioButton, GroupBox, ComboBox, ListBox, ProgressBar, Slider, and ScrollBar.
mwfl::ControlHost ui{*this};
ui.Add(name_, L"mwfl developer");
ui.Add(greet_, L"Say hello");
ui.Add(enabled_, L"Button enabled");
ui.Add(accent_);
ui.Add(progress_);
mwfl::Must(mwfl::AddItems(
accent_, {L"Sky blue", L"Graphite", L"Forest"}));
progress_.SetRange(0, 100);
progress_.SetValue(64);

Match 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();
}Every public child-control wrapper is shown with current creation code, its native result, and a link to the executable example that exercises it.

ui.Add(label_, L"Status");Controls example
ui.Add(button_, L"Save");Controls example
ui.Add(name_, L"Ada");Controls example
ui.Add(enabled_, L"Enabled");Controls example
ui.Add(choice_, L"Option A");Controls example
ui.Add(group_, L"Choices");Controls example
ui.Add(combo_);
SelectionAdapter<ComboBox, ThemeId> themes{combo_};
themes.Add(L"Dark", ThemeId::dark);Controls example
ui.Add(list_);
mwfl::AddItems(list_, items);Controls example
ui.Add(progress_).SetValue(64);Controls example
ui.Add(slider_).SetValue(50);Controls example
ui.Add(scroll_).SetRange(0, 100);Common Controls example
ui.Add(splitter_);
splitter_.AttachPanes(left, right);Common Controls example
ui.Add(tree_);
tree_.AddItem(L"Root");Common Controls example
ui.Add(list_);
list_.AddItem(L"Row");Common Controls example
ui.Add(header_);
header_.AddColumn(L"Column", 160);Common Controls example
model.Add({{1}, L"Tree", false, true});
tabs_.Synchronize(model);Common Controls example
ui.Add(combo_ex_);
combo_ex_.AddItem(L"Native");Common Controls example
ui.Add(date_);Common Controls example
ui.Add(calendar_);Common Controls example
ui.Add(hot_key_);
hot_key_.SetValue('K', HOTKEYF_CONTROL);Common Controls example
ui.Add(ip_);
ip_.SetValue(127, 0, 0, 1);Common Controls example
ui.Add(spin_);
spin_.SetBuddy(number_);Common Controls example
ui.Add(link_, L"<a>Docs</a>");Common Controls example
band.Add(toolbar_);
mwfl::AddButtons(toolbar_, buttons);Common Controls example
ui.Add(status_);
status_.SetParts({700, -1});Common Controls example
ui.Add(rebar_);
rebar_.AddBand(toolbar_, L"", 360);Common Controls example
ui.Add(pager_);
pager_.SetChild(content_);Common Controls example
ui.Add(animation_);
animation_.Open(instance, resource_id);Common Controls exampleDateTimePicker, MonthCalendar, HotKey, IpAddress, UpDown, and SysLink.
mwfl::ControlHost ui{*this};
ui.Add(date_);
ui.Add(calendar_);
ui.Add(hot_key_);
ui.Add(ip_);
ui.Add(spin_);
hot_key_.SetValue('K', HOTKEYF_CONTROL | HOTKEYF_ALT);
ip_.SetValue(127, 0, 0, 1);
spin_.SetBuddy(number_);
spin_.SetRange(0, 100);Toolbar, StatusBar, Rebar, Pager, and Animation.
mwfl::ControlHost ui{*this};
ui.Add(rebar_, {200}, rebar_bounds);
mwfl::ControlHost band{rebar_};
band.Add(toolbar_, {201}, toolbar_bounds);
mwfl::Must(mwfl::AddButtons(
toolbar_, {{{500}, L"Task Dialog"}}));
toolbar_.AutoSize();
rebar_.AddBand(toolbar_, L"", 360);
ui.Add(status_, {219}, status_bounds);
status_.SetParts({700, 980, -1});
mwfl::Must(mwfl::SetPartTexts(
status_, {{0, L"Native controls ready"}}));Compose DPI-aware layouts with margins, gaps, fixed, automatic, and weighted stretch tracks. The window rearranges attached controls on every resize.
using mwfl::operator""_dip;
SetLayout(
mwfl::Column()
.Margin(16.0_dip)
.Gap(10.0_dip)
.Add(title_, mwfl::Auto())
.Add(
mwfl::Row()
.Gap(8.0_dip)
.Add(name_, mwfl::Stretch())
.Add(greet_, mwfl::Fixed(100.0_dip)),
mwfl::Stretch())
.Add(status_, mwfl::Auto()));Two resizable native property pages with stable IDs, dirty tracking, validation, task-dialog feedback, Apply/OK/Cancel, and a versioned per-user registry schema.
auto candidate = committed_;
candidate.display_name = name_.GetText();
const auto saved = SaveSettings(
HKEY_CURRENT_USER, settings_key, candidate);
if (!saved.Succeeded()) {
ShowTaskDialog(page, L"Settings were not saved", ...);
return false; // keep the page dirty
}
committed_ = std::move(candidate);
return true;Owned ImageList with explicit toolbar borrowing, owned/updateable Tooltip text with borrowed tools, structured popup-menu results, modal TaskDialog, and Flat Scroll Bar integration.
images_.Create(16, 16);
images_.AddIcon(::LoadIconW(nullptr, IDI_INFORMATION));
tooltip_.Create(GetHwnd(), {.balloon = true, .max_width = 320});
tooltip_.AddTool(button_.GetHwnd(), L"Native tooltip");
tooltip_.UpdateTool(button_.GetHwnd(), L"Updated text owned by Tooltip");
const auto selected = popup_.TrackResult(GetHwnd(), screen_point);
if (selected) PostMessageW(GetHwnd(), WM_COMMAND, selected.command, 0);
const auto result = mwfl::ShowTaskDialog(
GetHwnd(), L"mwfl", L"Native Task Dialog", L"Real Common Controls UI.");::SendMessageW(control.GetHwnd(), ...). Thin wrappers do not close the native API surface.