MessageBox function Null safety user32
Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked.
int MessageBoxW(
HWND hWnd,
LPCWSTR lpText,
LPCWSTR lpCaption,
UINT uType
);
Implementation
int MessageBox(
int hWnd, Pointer<Utf16> lpText, Pointer<Utf16> lpCaption, int uType) {
final _MessageBox = _user32.lookupFunction<
Int32 Function(IntPtr hWnd, Pointer<Utf16> lpText,
Pointer<Utf16> lpCaption, Uint32 uType),
int Function(int hWnd, Pointer<Utf16> lpText, Pointer<Utf16> lpCaption,
int uType)>('MessageBoxW');
return _MessageBox(hWnd, lpText, lpCaption, uType);
}