var
i:ingeger;
begin
i:=Application.MessageBox('确认吗?','询问',MB_YesNoCancel+MB_IconQuestion);
if i=idyes then
...
else if i=idno then
...
else if i=idcancel then
...
end;
if MessageDlg('Welcome to my Object Pascal application. Exit now?',
mtConfirmation, [mbYes, mbNo], 0) = mrYes then
begin
MessageDlg('Exiting the Object Pascal application.', mtInformation,
[mbOk], 0);
Close;
end;