get_console_window_handle

Function get_console_window_handle 

pub fn get_console_window_handle<W: WindowsApi>(
    windows_api: &W,
    process_id: u32,
) -> HWND
Expand description

Return the Window Handle [HWND] for the foreground window associated with the given process_id.

If multiple foreground windows are associated with the given process_id it is undefined which [HWND] gets returned.

§Arguments

  • windows_api - Windows API operations implementation
  • process_id - ID of the process for which to retrieve the window handle.

§Returns

The Window Handle [HWND] for the window associated with the given process_id.