Forms Delphi

procedure TForm1.FormCreate(Sender: TObject);
var
MyRgn, ClientRgn, ButtonRgn: THandle;
Margin, X, Y: Integer;
begin
Margin := (Width - ClientWidth) div 2;
MyRgn := CreateRectRgn(0, 0, Width, Height);
X := Margin;
Y := Height - ClientHeight - Margin;
ClientRgn := CreateRectRgn(X, Y, X + ClientWidth, Y + ClientHeight);
CombineRgn(MyRgn, MyRgn, ClientRgn, RGN_XOR);
X := X + Button1.Left;
Y := Y + Button1.Top;
ButtonRgn := CreateRectRgn(X, Y, X + Button1.Width, Y + Button1.Height);
//-----------!!-----------
CombineRgn(MyRgn, MyRgn, ButtonRgn, RGN_XOR);
SetWindowRgn(Handle, MyRgn, True);
end;