Delphi XE
Is there any way to detect if a form has received a mouse click? The OnClick event in the form is only triggered on empty parts of the form. Any parts which have controls won't respond.
You'll need to filter queued messages to detect mouse events at a global level.
TApplication.OnMessage
.WM_MOUSEDOWN
or WM_MOUSEUP
as you please, and respond if the target window handle is that of the form, or a child control.If you really are trying to detect form activation, use OnActivate
.