A thread-safe FIFO queue of T.
Pairs a CommandQueue!T with a target window. post enqueues a command and wakes the UI thread with PostMessageW; the window's WndProc responds to the wake message by calling drain and processing the result.
Default wake message id, in the WM_APP..0xBFFF application-reserved range.
Cross-thread UI communication.
Background threads cannot touch Win32 controls directly — those belong to the UI thread. CommandQueue!T is a thread-safe FIFO; UiDispatcher!T pairs a queue with a target window so a worker can post a command and wake the UI thread, which then drains and processes the commands on its own turf.
The framework supplies only the mechanism. Applications define their own command type (typically an enum) and the WndProc handling for the wake message.