[lazarus] native Win32 Interface BugFix, maybe
Markus Lüdin
markus at luedin.com
Wed Aug 28 13:29:19 EDT 2002
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;
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;
More information about the Lazarus
mailing list