[Overview][Types][Procedures and functions][Variables][Index] |
Displays a modal dialog with the given text, caption, icon and buttons.
Source position: winapih.inc line 199
function MessageBox( |
hWnd: HWND; |
lpText: PChar; |
lpCaption: PChar; |
uType: Cardinal = MB_OK |
):Integer; |
hWnd |
|
Handle for the owner window, or 0 (default) when an owner is not available. |
lpText |
|
Pointer to the character values displayed in the content area for the dialog. |
lpCaption |
|
Pointer to the character values displayed as the title for the dialog. |
uType |
|
Flag values which indicate the icon, buttons, and behavior for the dialog. |
Integer value with the modal result for the dialog.
MessageBox is an Integer function used to display a modal dialog with the text, caption, icon and buttons specified using the arguments to the routine. It provides the common routine in the LCL interface used to access the platform-specific implementation of the routine for the widgetset class.
hWnd contains the handle for the window which is the owner of the dialog created and executed in the routine. The default value (0) indicates a handle is not available or not assigned for the owner window.
lpText is a PChar value with the text displayed on the modal dialog. Multi-line text can be used by embedding the end-of-line character sequence in the content.
lpCaption is a PChar value with the title displayed on the modal dialog.
uType is a Cardinal value which identifies the content and behavior for the modal dialog. It consists of flag values which can be OR-ed together and passed to the widgetset implementation. uType can contain flag values from the following flag groups:
Buttons (defined in lcltype.pp)
Icons (defined in lcltype.pp)
Default Buttons (defined in lcltype.pp)
The return value indicates the button selected on the modal dialog, and can be identified using the following Integer constants defined in lcltype.pp:
For example:
uses LCLIntf, LCLType; // ... function ShowResourceNotAvailableMessageBox: Integer; begin Result := MessageBox(0, PChar('Resource not available.'+#10+'Try again?'), PChar('Account Details'), MB_ICONWARNING or MB_ABORTRETRYIGNORE or MB_DEFBUTTON2); case Result of IDABORT: // needs to be implemented IDRETRY: // needs to be implemented IDIGNORE: // needs to be implemented end; end;
|
Display an message dialog with response buttons. |
|
|
Provides the routine used to display a message dialog in widgetset implementations. |
|
|
Widgetset-independent implementation of a message box routine. |
Version 3.2 | Generated 2024-02-25 | Home |