ui/win32
lib/ui/win32.vklib/ui/win32.vk
Windows 10/11 desktop polish & shell integration helpers (ui/win32).
- DWM window backdrop (Mica / Acrylic / Tabbed), dark titlebar, rounded corners, caption/border tint
- COM ITaskbarList3 taskbar progress value & state
- Window flashing, per-monitor DPI, topmost, layered opacity, theme detection, safe shell open/reveal
- Zero top-level mut globals; runs under allow-caps = [.ui] via direct ffi/* builtins
- Safe deterministic fallback when VEKO_HEADLESS=1 or running on non-Windows hosts
TaskbarHandle = struct { com_ptr i64 = ..., headless bool = ..., state enum = ..., completed i64 = ..., total i64 = ... }
is-windows? = fn [] bool
set-backdrop = fn [hwnd i64, mode enum] bool
Sets Windows 11 DWM backdrop (DWMWA_SYSTEMBACKDROP_TYPE = 38: .auto, .none, .mica, .acrylic, .tabbed).
set-dark-mode = fn [hwnd i64, dark bool] bool
Toggles immersive dark titlebar (DWMWA_USE_IMMERSIVE_DARK_MODE = 20).
set-corner-preference = fn [hwnd i64, pref enum] bool
Sets Windows 11 rounded corner preference (DWMWA_WINDOW_CORNER_PREFERENCE = 33: .default, .none, .round, .round_small).
set-caption-color = fn [hwnd i64, rgb i64] bool
Sets window caption color (DWMWA_CAPTION_COLOR = 35) from 0xRRGGBB.
set-border-color = fn [hwnd i64, rgb i64] bool
Sets window border color (DWMWA_BORDER_COLOR = 34) from 0xRRGGBB.
taskbar-init = fn [headless bool] TaskbarHandle
Initializes an ITaskbarList3 handle (returns headless handle when headless = true or in headless env).
taskbar-set-progress = fn [mut tb TaskbarHandle, hwnd i64, completed i64, total i64] bool
Updates taskbar button progress (ITaskbarList3::SetProgressValue, vtable index 9).
taskbar-set-state = fn [mut tb TaskbarHandle, hwnd i64, state enum] bool
Updates taskbar progress state (ITaskbarList3::SetProgressState, vtable index 10).
taskbar-release = fn [mut tb TaskbarHandle]
Releases the ITaskbarList3 COM object (IUnknown::Release, vtable index 2).
flash-window = fn [hwnd i64, count i64] bool
Flashes the window caption and taskbar button (FlashWindowEx with 32-byte x64 FLASHWINFO).
get-dpi = fn [hwnd i64] i64
Returns window DPI (or system DPI when hwnd == 0), clamped to >= 96.
set-window-topmost = fn [hwnd i64, topmost bool] bool
Toggles always-on-top (SetWindowPos with HWND_TOPMOST = -1 / HWND_NOTOPMOST = -2).
set-window-opacity = fn [hwnd i64, alpha_u8 i64] bool
Sets layered window alpha (0..255) via WS_EX_LAYERED + SetLayeredWindowAttributes.
is-windows-dark-theme? = fn [] bool
Queries HKCU\...\Themes\Personalize\AppsUseLightTheme (true = dark theme, defaults true on error/headless).
shell-open-url = fn [url str] bool
Opens url in the default browser after strict scheme & control-character validation.
shell-reveal-path = fn [path str] bool
Reveals path in Windows Explorer (explorer.exe /select,"<path>").