Unit 'Controls' Package
[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] [#lcl]


Checks for mouse click events for the specified control.


Source position: controls.pp line 2746

function CheckMouseButtonDownUp(

  const AWinHandle: TLCLHandle;

  const AWinControl: TWinControl;

  var LastMouse: TLastMouseInfo;

  const AMousePos: TPoint;

  const AButton: Byte;

  const AMouseDown: Boolean





Handle for the control where the mouse events were detected.



Control with the specified handle.



Mouse information for the mouse event examined in the routine.



Position where the last mouse event occurred.



Mouse button for the last mouse event.



True if the mouse event is a mouse down event. False for a mouse up event.

Function result

Value used as the Msg member in a mouse message.


CheckMouseButtonDownUp is a Cardinal function used to check for mouse down or up events for the control represented by the handle in AWinHandle. The return value contains the Word value used in the Msg member in a TLMMouse mouse message.

LastMouse contains the most recent mouse event information examined and potentially updated in the method.

CheckMouseButtonDownUp consolidates mouse down events (single, double, triple, and quadruple) into a single value used in a mouse message, and updates LastMouse when needed.

AWinControl contains the control with the handle where the event mouse events occurred.

At run-time, multi-click events are adjusted to the ControlStyle specified in the control (or one of its children) including:

If the target control does not allow one of the multi-click events, the click count in LastMouse is updated accordingly.

At design-time, only Single and Double click mouse events are handled.

CheckMouseButtonDownUp is used in the callback routine for a widgetset class when a mouse event message is created and passed to the class instance.

CT Web help

CodeTyphon Studio