Vcl.Dialogs.MessageDlgPos
Delphi
function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Integer;
function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
TaskDlgFlags: TTaskDialogFlags): Integer;
function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
DefaultButton: TMsgDlgBtn): Integer; overload;
function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
DefaultButton: TMsgDlgBtn; TaskDlgFlags: TTaskDialogFlags): Integer; overload;
function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer;
DefaultButton: TMsgDlgBtn; TaskDlgFlags: TTaskDialogFlags; CustomButtonCaptions: array of string): Integer; overload;
C++
extern DELPHI_PACKAGE int __fastcall MessageDlgPos(const System::UnicodeString Msg, System::Uitypes::TMsgDlgType DlgType, System::Uitypes::TMsgDlgButtons Buttons, System::LongInt HelpCtx, int X, int Y)/* overload */;
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | Vcl.Dialogs.pas Vcl.Dialogs.hpp |
Vcl.Dialogs | Vcl.Dialogs |
Description
Displays a message dialog box at the specified screen coordinates.
Call MessageDlgPos to bring up a message box at a particular location when you do not need to specify a caption. (If you need to specify the caption as well, use the MessageDlg function.)
Msg
is the content of the message that appears.
DlgType
indicates the purpose of the dialog. See the Vcl.Dialogs.TMsgDlgType page for a list of possible values.
Buttons
indicates what buttons should appear in the message box. Buttons
is of type Vcl.Dialogs.TMsgDlgButtons.
HelpCtx
specifies the context ID for the help topic that should appear when the user clicks the help button or presses F1 while the dialog is displayed.
X
and Y
specify the screen coordinates where the dialog should appear. A value of –1 means that the message box can appear anywhere in the specified dimension.
DefaultBtn
specifies which button from among those specified by Buttons
is the default button for the dialog. If DefaultBtn
is mbNo
, then there is no default button set. See the Vcl.Dialogs.TMsgDlgType page for a list of possible enumerations.
Note: If the user types CTRL+C in the message box, the text of the message is copied to the clipboard.
Having mtConfirmation
Show a Question Mark
Dialog boxes of TMsgDlgType.mtConfirmation type show an information icon.
In the past, they used to show a question mark instead, but Microsoft removed the question mark symbol from the Windows API function that the VCL uses to display TMsgDlgType.mtConfirmation
dialog boxes. Quoting Microsoft:
- "The question-mark message icon is no longer recommended because it does not clearly represent a specific type of message and because the phrasing of a message as a question could apply to any message type. In addition, users can confuse the message symbol question mark with Help information."
To use the previous dialog box appearance, you must set the UseLatestCommonDialogs
variable of the Vcl.Dialogs unit to False
.