unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    btnCANCEL: TButton;
    btnOK: TButton;
    procedure btnOKClick(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private

  public

  end;

var
  Form2: TForm2;

implementation
{$R *.dfm}
{------------------------------------------------------------------------------}
procedure TForm2.btnOKClick(Sender: TObject);
begin
	ShowMessage('Zamykanie okna zablokowane - sprawdz w jaki sposób');
   ModalResult := mrNone;
end;

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
	Action := caFree;
end;

procedure TForm2.FormDestroy(Sender: TObject);
begin
	Form2 := Nil;
end;

end.
