GetForegroundWindow function Null safety user32

int GetForegroundWindow()

Retrieves a handle to the foreground window (the window with which the user is currently working). The system assigns a slightly higher priority to the thread that creates the foreground window than it does to other threads.

HWND GetForegroundWindow();

Implementation

int GetForegroundWindow() {
  final _GetForegroundWindow = _user32
      .lookupFunction<IntPtr Function(), int Function()>('GetForegroundWindow');
  return _GetForegroundWindow();
}