[lazarus] Win32: moving and message handling

Micha Nelissen M.Nelissen at student.tue.nl
Sun Jul 6 09:29:02 EDT 2003


Hi,

I still have to object again the latest patch for WM_MOVE handling, the 
previous one was better. That is because the internal variables haven't 
been updated when WM_MOVE is sent, only after it has been processed they 
are updated. So when GetWindowRect is called it retrieves the wrong 
values. So use the information in the LParam at least:

XPos := LoWord(LParam);
YPos := HiWord(LParam);

(Maybe compensate for client rect ourselves, but certainly don't use the 
GetWindowRect / GetClientRect functions). This also explains the weird 
behaviour of maximizing: The form stays the same size because 
GetClientRect returns the previous client size, not the current one.

About message handling: maybe it would be better the always first pass 
the message into the LCL, then if the LCL doesn't handle, let it pass 
through and call the default window proc in DefaultHandler. The problem 
is that now the LCL first receives WM_MOVE and then WM_WINDOWPOSCHANGED 
because internally windows calls WM_MOVE inside handling the 
WM_WINDOWPOSCHANGED.

Regards,

Micha.







More information about the Lazarus mailing list