Con tu permiso oscarac, quisiera mostrar tu función modificada por mí, pra que me funcionara:
Código Delphi
[-]
function _Alert(const Msg: string; msgCaption: string; AType: TMsgDlgType;
AButtons: TMsgDlgButtons; Captions: array of string): Integer;
var
unMsgDlg: TForm;
i: Integer;
dlgButton: TButton;
captionIndex: Integer;
begin
captionIndex := 0;
try
unMsgDlg := CreateMessageDialog(Msg,AType,AButtons);
unMsgDlg.Caption:= msgCaption;
for i := 0 to unMsgDlg.ComponentCount - 1 do
begin
if (unMsgDlg.Components[i] is TBitBtn) then
begin
dlgButton := TButton(unMsgDlg.Components[i]);
if CaptionIndex > High(Captions) then Break;
dlgButton.Caption := Captions[CaptionIndex];
Inc(CaptionIndex);
end;
end;
Result := unMsgDlg.ShowModal;
finally
unMsgDlg.Free;
end;
end;
La uso así:
Código Delphi
[-]
if _Alert('¿Desea salir del sistema Zeus4Linux 1.0?','Responda',mtConfirmation,
[mbYes, mbNo],['Sí','No']) = mrYes then...