Vcl.Dialogs.TaskMessageDlgPos

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function TaskMessageDlgPos(const Title, Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Integer;
function TaskMessageDlgPos(const Title, Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; DefaultButton: TMsgDlgBtn): Integer; overload;

C++

extern DELPHI_PACKAGE int __fastcall TaskMessageDlgPos(const System::UnicodeString Title, const System::UnicodeString Msg, System::Uitypes::TMsgDlgType DlgType, System::Uitypes::TMsgDlgButtons Buttons, int HelpCtx, int X, int Y)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
Vcl.Dialogs.pas
Vcl.Dialogs.hpp
Vcl.Dialogs Vcl.Dialogs

Description

Displays a message task dialog box at the specified screen coordinates.

Call TaskMessageDlgPos 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.

Bitmap is an image that appears on the face of the message dialog. If Bitmap is nil (Delphi) or NULL (C++), there is no image unless DlgType is mtConfirmation.

MessageDlgPos returns the value of the button the user selected. The table on the Vcl.Dialogs.TMsgDlgBtn page lists the values for each type of button that can appear in the message box, and the corresponding value that is returned if the user selects that button.

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.

See Also

Code Examples