Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-10

ManualDock and HWND change

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

And3mD

Hello

When I try to do multiline captions in buttons with:

SetWindowLong(btnWordWrapCaption.Handle,
GWL_STYLE,GetWindowLong(btnWordWrapCaption.Handle, GWL_STYLE) or BS_MULTILINE);

I found strange behavior. In FormCreate it doesn't work but in onclick works ok.

I made some tests and the strange behavior appears only on docked forms (for example to Panel).

Window and button have different Handle before and after Docking.

Please see my test project:

http://and3md.xon.pl/lazarus/wordwrapbuttonhwnd.zip

When application start shows Form2.Handle and btnWordWrapCaption.Handle. Next click 'Dock form2 to Panel' and showed 'Mullti line caption' button to see new window and button Handle.

Is it a bug or I don't know something about LCL?

Greetings
Andrzej Kilijanski

Reply by email

Paul Ishenin
to And3mD
And3mD wrote
Window and button have different Handle before and after Docking.

Yes, handle recreates on dock/undock operations and on any other parent change.

Best regards,
Paul Ishenin.

Reply by email