TCustomTaskDialog.Execute function
Displays the task dialog and captures the modal result value.
Declaration
function Execute: Boolean; dynamic; overload
function Execute(ParentWnd: HWND): Boolean; dynamic; overloadDescription
Execute is an overloaded
Boolean function used to
display the dialog and capture the value for the ModalResult property. The
parameterless variant is normally called to display and execute the dialog
form. It gets the handle for the active form which is used as the parent for
the task dialog form from the Screen singleton. If a TCustomForm has not been
assigned in Screen, the unassigned handle value (0) is used. The overloaded
variant is called using the handle value as an argument.
Execute calls the DoExecute method to perform actions needed to
initialize and display the dialog form. It also processes return values used in
properties like ModalResult, QueryResult, QueryItemIndex, Button, and
RadioButton.
The return value is True if the dialog was successfully displayed and a valid button identifier was clicked to close the dialog - including when Esc, Alt+F4 or the Cancel button is used.
See also
An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.
