I have a main form where I set a handler for the Application.OnMessage
event. (Code of this handler is placed in the main form). Then, while running the program, there can be calls to SysUtils.LoadPackage
that loads some bpl-package. And after that is loaded, the handler of Application.OnMessage
is changed.
I couldn't find what doing this. At least there is not right such code that goes Application.OnMessage :=
in the package.
One more thing: in the debugger, before LoadPackage, I see OnMessage handler described as Main.TMainForm.AppMessage
. All other handlers (such as OnMinimize, OnModalBegin e.t.c.) are nil. And after LoadPackage all events have handlers, described as Vcl.AppEvnts.TMultiCaster.DoMessage
.