capture_hwnd_for_label

Function capture_hwnd_for_label 

Source
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:

  1. Fast path: browser.host().window_handle() — may be non-NULL by this point even in CEF Views mode (window fully shown).
  2. 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).