Module wndproc

Module wndproc 

Source
Expand description

Win32 frameless window setup + wndproc subclass. Extracted from client/mod.rs in task #182 PR-G.

Statics§

FOCUS_RESTORE_WNDPROCS 🔒
Map of top-level HWND -> original WndProc for the focus-restore subclass installed by install_top_level_focus_restore_hook. Kept separate from ORIGINAL_WNDPROCS so the two hooks can coexist on the same HWND in either order (the focus-restore hook always passes through to its own recorded original, which transitively walks back through any other hook).
ORIGINAL_WNDPROCS 🔒
Map of HWND -> original WndProc for secondary windows with edge resize hooks. Stored here instead of GWLP_USERDATA to avoid clobbering CEF’s data.

Functions§

install_frameless_resize_hook 🔒
Install a WndProc hook on a SECONDARY window that handles:
install_top_level_focus_restore_hook 🔒
Subclass a top-level window’s WndProc to handle WM_ACTIVATE: when the window is being activated (wparam != WA_INACTIVE), look up the last intentionally-focused child for this root in LAST_FOCUSED_BY_ROOT and SetFocus it. Closes the alt-tab-back-and-input-drops bug.
set_window_icon 🔒
Load the app icon from the exe’s embedded resource and set it on the window. This makes the icon appear in the taskbar and Alt+Tab switcher instead of the default CEF/Chromium icon.
setup_native_frameless 🔒
Set up a native frameless window: extend client area over the thick frame border so the resize handle is invisible, then subclass the window to handle WM_NCHITTEST for edge resize.
skip_taskbar 🔒
Hide the given top-level HWND from the Windows taskbar via ITaskbarList::DeleteTab. The window remains fully usable — Alt-Tab still finds it, it takes focus, repaints, etc. — but the shell paints no taskbar button for it regardless of the user’s “Combine taskbar buttons” setting.