Forum > General

Easy Message hooking for forms. UNIT and TEST PROJECT Attached.

<< < (2/2)

Polarx79:
Thanks for the contribution!  :)

pcurtis:
Jamie, I have been testing msgHook and found a small problem.

When I add a message, then change formstyle from fsSystemontop to fsNormal LCL controls on the form disappear!

Any ideas?

Demo attached.

pcurtis:
Thanks Jamie for the response.

The Remove - Change formstyle - Add is the way I solved the issue, but thought there might be a better solution. If its a LCL issue then I'll have to live with it.

Again thanks, and thanks for releasing the unit.

PascalDragon:

--- Quote from: Mr.Madguy on August 30, 2020, 09:48:35 am ---Using list for this is way too slow. Delphi uses MakeObjectInstance and FreeObjectInstance from Classes unit for this purpose. Their implementation is ugly, but it looks like, that it's made for max performance. Problem is - they use runtime code generation, that isn't cross-platform, I guess. I.e. platform-dependent inc file is needed.

--- End quote ---

These are two different use cases:

* MakeObjectInstance is to add message handling capability to any class that does not have a Handle associated with it
* The purpose of jamie's code is to have the form (which does have a Handle associated after all) handle messages that the LCL would otherwise discard; it's essentially a more comfortable variant of this

Navigation

[0] Message Index

[*] Previous page

Go to full version