[Lazarus] Unmoveable forms?

Luca Olivetti luca at wetron.es
Fri Jun 27 16:29:53 CEST 2008


En/na Luca Olivetti ha escrit:
> En/na Felipe Monteiro de Carvalho ha escrit:
>> Just use the same code you were using in Delphi. It will work in Windows only.
> 
> No, the same code doesn't work, I don't receive the messages, probably 
> the LCL isn't forwarding them.
> I tried both with WM_NCHITTEST and LM_NCHITTEST.
> 
> What I got mostly working is to use SetWindowProc as per
> http://wiki.lazarus.freepascal.org/Win32/64_Interface#Processing_non-user_messages_in_your_window

I added what I did as an example in the wiki

> at least for WM_NCHITTEST, not yet for WM_INITMENUPOPUP.

I cannot make it work, I put this code in my handler:

   if uMsg=WM_INITMENUPOPUP then
   begin
     if hi(LParam)<>0 then
     begin
       EnableMenuItem(HMENU(WParam), SC_MOVE, MF_BYCOMMAND or MF_GRAYED);
       result:=0;
       exit;
     end
   end;


I get the message, LParam indicates it's the system menu, I call 
EnableMenuItem but the "move" command is still there enabled.

Bye
-- 
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004      Fax +34 93 5883007



More information about the Lazarus mailing list