[lazarus] GetWindowRelativePosition implementation patch forwin32

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Jul 7 03:43:05 EDT 2003


On Mon, 07 Jul 2003 00:29:58 -0300
Karl Brandt <pascalive at bol.com.br> wrote:

> I noticed that Mattias added a new WinApi function which doesn't exist
> in win32.

It was:
function GetWindowRelativePosition(Handle : hwnd; var Left, Top: integer):
boolean;

It returns the Left, Top, relative to the client origin of its parent. This
is the same as TControl.Left, TControl.Top. But during resizing these values
do not always correspond. The LCL uses this function to sync itself with the
interface.
I also added a default implementation in interfacebase, based on other
functions, already implemented. So, the interfaces don't need to implement
it. The gtk-interface overrides it and provides a faster implementation.


> Attached is a implementation.

Hmm. You used GetWindowRect, which returns the left,top in screen
coordinates. I don't think, that this is correct, so I replaced its
implementation with a call to inherited.


> The patch also removes a not necessary call to GetClientRect in WM_SIZE.
> 
> This fixes the problem i previous noticed after the WMMove/WMSize 
> modifications.

I will make some tests with resizing ...


Mattias






More information about the Lazarus mailing list