FindWindowEx function Null safety user32

int FindWindowEx(
  1. int hWndParent,
  2. int hWndChildAfter,
  3. Pointer<Utf16> lpszClass,
  4. Pointer<Utf16> 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.

HWND FindWindowExW(
  HWND    hWndParent,
  HWND    hWndChildAfter,
  LPCWSTR lpszClass,
  LPCWSTR lpszWindow
);

Implementation

int FindWindowEx(int hWndParent, int hWndChildAfter, Pointer<Utf16> lpszClass,
    Pointer<Utf16> lpszWindow) {
  final _FindWindowEx = _user32.lookupFunction<
      IntPtr Function(IntPtr hWndParent, IntPtr hWndChildAfter,
          Pointer<Utf16> lpszClass, Pointer<Utf16> lpszWindow),
      int Function(int hWndParent, int hWndChildAfter, Pointer<Utf16> lpszClass,
          Pointer<Utf16> lpszWindow)>('FindWindowExW');
  return _FindWindowEx(hWndParent, hWndChildAfter, lpszClass, lpszWindow);
}