DialogBoxIndirectParam function Null safety user32

int DialogBoxIndirectParam(
  1. int hInstance,
  2. Pointer<DLGTEMPLATE> hDialogTemplate,
  3. int hWndParent,
  4. Pointer<NativeFunction<DlgProc>> lpDialogFunc,
  5. int dwInitParam
)

Creates a modal dialog box from a dialog box template in memory. Before displaying the dialog box, the function passes an application-defined value to the dialog box procedure as the lParam parameter of the WM_INITDIALOG message. An application can use this value to initialize dialog box controls.

INT_PTR DialogBoxIndirectParamW(
  HINSTANCE       hInstance,
  LPCDLGTEMPLATEW hDialogTemplate,
  HWND            hWndParent,
  DLGPROC         lpDialogFunc,
  LPARAM          dwInitParam
);

Implementation

int DialogBoxIndirectParam(
    int hInstance,
    Pointer<DLGTEMPLATE> hDialogTemplate,
    int hWndParent,
    Pointer<NativeFunction<DlgProc>> lpDialogFunc,
    int dwInitParam) {
  final _DialogBoxIndirectParam = _user32.lookupFunction<
      IntPtr Function(
          IntPtr hInstance,
          Pointer<DLGTEMPLATE> hDialogTemplate,
          IntPtr hWndParent,
          Pointer<NativeFunction<DlgProc>> lpDialogFunc,
          IntPtr dwInitParam),
      int Function(
          int hInstance,
          Pointer<DLGTEMPLATE> hDialogTemplate,
          int hWndParent,
          Pointer<NativeFunction<DlgProc>> lpDialogFunc,
          int dwInitParam)>('DialogBoxIndirectParamW');
  return _DialogBoxIndirectParam(
      hInstance, hDialogTemplate, hWndParent, lpDialogFunc, dwInitParam);
}