In VCL I can change the shape of a form using SetWindowRgn. I would like to do the same with a FireMonkey App when it is on the Windows platform. I would also like to do it on macOS as well, but that may be asking a bit much.
The code I tried compiles, but has no discernible effect:
procedure TfrmMain.FormCreate(Sender: TObject); {$IFDEF MSWINDOWS} var regn: HRGN; {$ENDIF} begin {$IFDEF MSWINDOWS} regn := CreateRoundRectRgn(0, 0, ClientWidth, ClientHeight, 40, 40); SetWindowRgn(WindowHandleToPlatform(Self.Handle).Wnd, regn, True); {$ENDIF} end;
Note that I have already turned the borders off with BorderStyle = None in the Object Inspector.
Is there another way of shaping forms in FireMonkey? Could the other controls on the form (e.g. a toolbar) interfere with the rounded corners.