Get the active TWinControl under the mouse cursor

Get the active TWinControl under the mouse cursor
You may call this function in a global event procedure,
linking as many components events to it as you need.

function FindControlAtPos: TWinControl;
var
  Pt: TPoint;
begin
  GetCursorPos(Pt);
  Result := FindControl(WindowFromPoint(Pt));
end;

(example) There’s the global proc for the OnMouseUp event.
Note: OnClick keeps working, so you can “add” the OnMouseUp
facility to no cost.

procedure TForm1.GenericMouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var
  TWC: TWinControl;
begin
  TWC := FindControlAtPos;
  //what for a class !
  Showmessage('Here we are: ' + TWC.ClassName);
  //Let it blink...
  TWC.Visible := False;
  Sleep(150);
  TWC.Visible := True;
end;