Skip to main content
Module

x/win32/mod.ts>MessageBox

Wraps some of the most common Win32 API calls using FFI to make them accessible to Deno.
Latest
function MessageBox
import { MessageBox } from "https://deno.land/x/win32@0.1.1/mod.ts";

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.

Parameters

A handle to the owner window of the message box to be created. If this parameter is NULL, the message box has no owner window.

lpText: string

The message to be displayed. If the string consists of more than one line, you can separate the lines using a carriage return and/or linefeed character between each line.

lpCaption: string

The dialog box title. If this parameter is NULL, the default title is Error.

uType: number

The contents and behavior of the dialog box. This parameter can be a combination of flags from the following groups of flags.

Returns

number

If a message box has a Cancel button, the function returns the IDCANCEL value if either the ESC key is pressed or the Cancel button is selected.

If the message box has no Cancel button, pressing ESC will no effect - unless an MB_OK button is present.

If an MB_OK button is displayed and the user presses ESC, the return value will be IDOK.

If the function fails, the return value is zero. To get extended error information, call GetLastError.