pub(crate) fn capture_hwnd_for_label(state: &Arc<AppState>, label: &str)Expand description
Capture and store the HWND for label in AppState::window_hwnds.
Called from set_window_init_status once the frontend signals “ready”.
Two-pass approach:
- Fast path:
browser.host().window_handle()— may be non-NULL by this point even in CEF Views mode (window fully shown). - Fallback: enumerate all process-owned visible HWNDs and pick the one
not yet registered in
window_hwnds. Reliable because windows are opened sequentially (pool windows are hidden before promotion).