This works fine:
procedure TFormTest.WndProc(var Message: TMessage);
begin
inherited;
if Message.LParam = longint(Label1) then begin
case Message.Msg of
CM_MOUSELEAVE : Label2.Caption := 'CM_MOUSELEAVE';
CM_MOUSEENTER : Label2.Caption := 'CM_MOUSEENTER';
end;
end;
end;
Until I put Label1 in a TPanel. If I catch WndProc of Label1, instead of
the Form, I can make it work but there must be a better solution.
I tried Internet but couldn't find a solution (WndProc and controls in
TPanels).
Thanks,
Fons.