unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

uses Math;

{
procedure TForm1.FormCreate(Sender: TObject);
var
  promien :Integer;
  wysPaskaTytulu :Integer;
  rgn :HRGN;
begin
wysPaskaTytulu:=Height-ClientHeight;
promien:=Min(ClientWidth,ClientHeight);
rgn := CreateEllipticRgn(0, wysPaskaTytulu, promien, promien);
SetWindowRgn(Handle,rgn,true);
end;
}

procedure TForm1.FormCreate(Sender: TObject);
var
  promien :Integer;
  wysPaskaTytulu :Integer;
  rgn,rgnIkony,rgnOkno :THandle;//:HRGN;
begin
//SetWindowRgn(Handle,CreateEllipticRgn(0, Height-ClientHeight, Min(ClientWidth,ClientHeight), Min(ClientWidth,ClientHeight)),True);

wysPaskaTytulu:=Height-ClientHeight;
promien:=Min(ClientWidth,ClientHeight);
rgn := CreateEllipticRgn(0, wysPaskaTytulu, promien, promien);
rgnIkony := CreateRectRgn(Width-75, 0, Width, wysPaskaTytulu);
CombineRgn(rgn,rgn,rgnIkony,RGN_OR);
SetWindowRgn(Handle,rgn,True);

{wysPaskaTytulu:=Height-ClientHeight;
promien:=Min(Width,Height);
rgn := CreateEllipticRgn(0, wysPaskaTytulu, promien, promien);
rgnOkno := CreateRectRgn(0, 0, Width, Height);
CombineRgn(rgn,rgnOkno,rgn,RGN_DIFF);
SetWindowRgn(Handle,rgn,True);}
end;

end.
