[lazarus] native Win32 Interface BugFix, maybe

Keith Bowes keith_bowes at hotmail.com
Wed Aug 28 15:28:33 EDT 2002


>From: Markus Lüdin <markus at luedin.com>
>
>Hi All
>
>I'm playing around with the native win32 interface and my compiled examples
>were always jumping around when I resized or moved them...so I spent
>some hours reading code and debuging the win32 Interface and I
>found following solution for the problem...I only hope it's not something
>that's already fixed :-) Because I used the daily sources and no the cvs
>access.....*pray*
>Could somone check that? And maybe add this changes to the cvs tree?
>
>Regards
>Markus
>
>File: win32object.inc
>procedure: TWin32Object.ResizeChild
>comment: Probably some debug code...
>changes:
>
>//  if Sender is TCustomForm then
>//  begin
>//    inc(Width, 50);
>//    inc(Height, 50);
>//  end;
>

I added this code a couple days ago because forms are always too small.  
It's a hack until somebody can figure out why it happens.

>File: win32callback.inc
>procedure: WindowProc
>comments: WM_SIZE and WM_MOVE return the new Client Size and Client Pos in
>LParam not the Window Size!!!
>  so i call GetWindowRect and get the window size....
>changes:

>
>     WM_SIZE:
>     Begin
>       Windows.GetWindowRect(Window, @Rect);
>       With TLMSize(LMessage) Do
>       Begin
>         Msg := LM_SIZE;
>         SizeType := WParam;
>         Width := Rect.Right-Rect.Left;
>         Height := Rect.Bottom-Rect.Top;
>       End;
>     End;
>
>     WM_MOVE:
>     Begin
>       Windows.GetWindowRect(Window, @Rect);
>       With TLMMove(LMessage) Do
>       Begin
>         Msg := LM_MOVE;
>//        MoveType := WParam;   WParam is not defined!
>         MoveType := 0;
>         XPos := Rect.Left;
>         YPos := Rect.Top;
>       End;
>     End;
>

Thanks, the forms don't jump around a lot now.  Your changes have been 
committed.

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx






More information about the Lazarus mailing list