[lazarus] Win32: moving and message handling

Micha Nelissen M.Nelissen at student.tue.nl
Mon Jul 7 04:46:16 EDT 2003


Karl Brandt wrote:

> Micha Nelissen wrote:
> 
>> 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:
> 
> 
> I'd like to thank you by the progresses you made in LCL recently, but i 
> think in this case you are wrong.

I am not drawing any conclusions yet, I am just saying the current 
approach is not working OK.

> First i must say that this aproach isn't mine: it was there for a long 
> time and Martin Smat excluded it 3 months ago, causing that strange 
> effects in moving/resizing
> The GetWindowRect is a windows API function and retrieves the actual 
> position of the window (is not related to LCL).
> 
>> XPos := LoWord(LParam);
>> YPos := HiWord(LParam);
> 
> 
> These values are the position of clientarea wich are something bigger 
> than windowarea
> Try the following:
> change source to
> XPos := LoWord(LParam);
> YPos := HiWord(LParam);
> make a simple form program with top,left=(0,0);
> make breakpoints in WM_MOVE, WMMove;
> the prog will stop after the sizing proccess (WindowMove fires WM_Move);
> you will see that XPos and YPos are something bigger than 0

I see. I am now working on a function to convert those to the wanted 
coordinates.

Regards,

Micha.







More information about the Lazarus mailing list