unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  if MessageDlg('Czy zakończyć program?', mtConfirmation,[mbYes,mbNo],0)=mrYes
  then Application.Terminate;
end;

procedure TForm1.Button2Click(Sender: TObject);
var i:word;
begin
  if WindowState=wsNormal then
  begin
    i:=MessageDlgPos('Okienko wewnatrz formularza'+#13+'jesli się zmieści :-)', mtCustom, mbYesNoCancel, 0,
    Left+20,Top+20);
    case i of
       mrYes: Label1.Caption:='Naciśnięto Yes';
       mrNo: Label1.Caption:='Naciśnięto No';
       mrCancel: Label1.Caption:='Naciśnięto Cancel';
    end
 end
 else
   MessageDlg('Okienko wewnątrz formularza', mtCustom, mbYesNoCancel, 0);
end;

end.
