EnumDisplayMonitors function Null safety user32

int EnumDisplayMonitors (
  1. int hdc,
  2. Pointer<RECT> lprcClip,
  3. Pointer<NativeFunction<MonitorEnumProc>> lpfnEnum,
  4. int dwData
)

The EnumDisplayMonitors function enumerates display monitors (including invisible pseudo-monitors associated with the mirroring drivers) that intersect a region formed by the intersection of a specified clipping rectangle and the visible region of a device context. EnumDisplayMonitors calls an application-defined MonitorEnumProc callback function once for each monitor that is enumerated. Note that GetSystemMetrics (SM_CMONITORS) counts only the display monitors.

BOOL EnumDisplayMonitors(
  HDC             hdc,
  LPCRECT         lprcClip,
  MONITORENUMPROC lpfnEnum,
  LPARAM          dwData
);

Implementation

int EnumDisplayMonitors(int hdc, Pointer<RECT> lprcClip,
    Pointer<NativeFunction<MonitorEnumProc>> lpfnEnum, int dwData) {
  final _EnumDisplayMonitors = _user32.lookupFunction<
      Int32 Function(IntPtr hdc, Pointer<RECT> lprcClip,
          Pointer<NativeFunction<MonitorEnumProc>> lpfnEnum, IntPtr dwData),
      int Function(
          int hdc,
          Pointer<RECT> lprcClip,
          Pointer<NativeFunction<MonitorEnumProc>> lpfnEnum,
          int dwData)>('EnumDisplayMonitors');
  return _EnumDisplayMonitors(hdc, lprcClip, lpfnEnum, dwData);
}