{ Sie konnen z.B diese Funktion in einer allgemein gultigen Prozedure aufrufen, die Sie dann allen betroffenen Ereignisse zuweisen. } { You may call this function in a global event procedure, linking as many components events to it as you need. } functionFindControlAtPos: TWinControl; var
Pt: TPoint; begin
GetCursorPos(Pt); Result := FindControl(WindowFromPoint(Pt)); end
; { (Beispiel) Hier die allgemein gultige Procedure fur OnMouseUp. Die Behandlung von OnClick bleibt dabei erhalten: die Funktionalitat aus OnMouseUp kommt dazu. } { (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
;