FindWindowEx function user32

Win32Result<HWND> FindWindowEx(
  1. HWND? hWndParent,
  2. HWND? hWndChildAfter,
  3. PCWSTR? lpszClass,
  4. PCWSTR? lpszWindow,
)

Retrieves a handle to a window whose class name and window name match the specified strings.

The function searches child windows, beginning with the one following the specified child window. This function does not perform a case-sensitive search.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-findwindowexw.

Implementation

Win32Result<HWND> FindWindowEx(
  HWND? hWndParent,
  HWND? hWndChildAfter,
  PCWSTR? lpszClass,
  PCWSTR? lpszWindow,
) {
  final result_ = FindWindowExW_Wrapper(
    hWndParent ?? nullptr,
    hWndChildAfter ?? nullptr,
    lpszClass ?? nullptr,
    lpszWindow ?? nullptr,
  );
  return .new(value: .new(result_.value.ptr), error: result_.error);
}