En/na Luca Olivetti ha escrit: > En/na Felipe Monteiro de Carvalho ha escrit: >> On Wed, Apr 16, 2008 at 11:12 AM, Luca Olivetti <[EMAIL PROTECTED]> wrote: >>> With delphi I used a trick involving windows messages to make a form >>> unmoveable: >> I don't think this is implementable in a cross-platform way. On X11 >> the conection with the window manager is loose, and it may ignore any >> request you make. > > Well, I just need it under windows right now, it would just be nice if > it could be done in a cross platform way, but it's not a strict requirement > >> If you don't want the user to move the form and set the borderstyle to >> bsNone. You can paint your own title if you really need one. > > Oh, but I like the system-drawn title bar with the application icon and > the big X to close the form ;-) > >> Having said that, I can't imagine why one would wish to do this. > > My main reason is that the layout of the screeen(s) has to be fixed, > besides avoiding the dragging of the form avoids freezing threads > waiting on a Synchronize (though dragging a scrollbar will freeze them > anyway, and that's really bad for my application). > I'm not the only one with such a need (i.e. unmoveable forms), since I > found that trick somewhere in the internet many years ago.
I'm sorry to revive this old thread, but I'm going to need it, at least under windows. Any other suggestion (besides BorderStyle:=bsNone)? As a remainder, with delphi I used to to this: 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; Bye -- Luca Olivetti Wetron Automatización S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007 _______________________________________________ Lazarus mailing list Lazarus@lazarus.freepascal.org http://www.lazarus.freepascal.org/mailman/listinfo/lazarus