With delphi I used a trick involving windows messages to make a form unmoveable:
procedure WMNCHitTest(var Msg: TWMNCHitTest);message WM_NCHitTest;
procedure WMInitMenuPopup(var Msg: TWMInitMenuPopUp);message
WM_INITMENUPOPUP;[...]
procedure TMainFrm.WMNCHitTest(var Msg: TWMNCHitTest);
begin
inherited;
if Msg.Result=Windows.HTCAPTION then
begin
Msg.Result:= Windows.HTCLIENT
end;
end;
procedure TMainFrm.WMInitMenuPopup(var Msg: TWMInitMenuPopup);
begin
inherited;
if Msg.SystemMenu then
EnableMenuItem(Msg.MenuPopup, SC_MOVE, MF_BYCOMMAND or MF_GRAYED)
end;Is there a way to do the same with lazarus? (and possibly in a cross-platform way?).
I tried to crudely reset Top and Left in OnChangeBounds but the effect is really ugly.
Bye
