If you start with the CreateMessageDialog function in dialogs unit, then you have access to the underlying form.
procedure TForm1.Button2Click(Sender: TObject);
var
F: TForm;
i: Integer;
C: TComponent;
B: TBitBtn;
Res: TModalResult;
begin
F := CreateMessageDialog('Dare to take a choice?', 'Do you want to format your harddrive?', mtConfirmation, [mbYes, mbNo, mbAbort, mbRetry, mbCancel, mbOK]);
for i := 0 to F.ComponentCount-1 do
begin
C := F.Components[i];
if (C is TBitBtn) then
begin
B := TBitBtn(C);
case B.Kind of
bkYes: B.Caption := 'No';
bkNo: B.Caption := 'Yes';
bkAbort: B.Caption := 'Ok';
bkRetry: B.Caption := 'Cancel';
bkCancel: B.Caption := 'Retry';
bkOk: Caption := 'Abort';
end;
end;
end;
Res := F.ShowModal;
F.Free;
end;
In this simple code I change the buttons captions, just to confuse them.
You can do anything you want with the buttons now you have access to them.
I use a similar approach to have a checkbox with "Don't show this dialog anymore" on the dialog.
Note: You cannot access the components anymore after you freed the form (F in this case).
Bart