appevents OnAppMouseDown event
Example
Return to Introduction  Previous page  Next page
Applies to
acAppEvents component.  

Declaration
type  
  TacAppMouseEvent = procedure(Sender: TObject; Button: TMouseButton; Shift: TShiftState; ScreenPoint: TPoint; WindowHandle: hWnd; HitTestCode: Integer) of object;  
 
property OnAppMouseDown: TacAppMouseEvent;  

Description
The OnAppMouseDown event occurs when the user presses a mouse button in ANY window on ANY control within entire application. Use the OnAppMouseDown to handle all mouse clicks within any control of your program.  
 
The coordinates where user presses a mouse button returned by ScreenPoint parameter (yes, this point in screen coordinates. Check out an example to see how to convert the screen coordinates to coordinates of local control). Window handle of control returned by WindowHandle parameter.  

Parameters
ButtonDetermines the mouse button. Possible return values is mbLeft for left mouse button, mbRight for right and mbMiddle if middle mouse button pressed;  
ShiftDetermines the current state of the control keys — Ctrl, Shift and Alt.  
ScreenPointThe X and Y screen coordinates where user pressed a mouse button;  
WindowHandleThe window handle of control where user pressed a mouse button.  
HitTestCodeThe code which identifies the hot sport of control if user pressed a mouse button outside of control's client area. Check out WM_NCHITTEST message in the Win32 API reference for more details.  

See also
OnAppMouseUp and OnAppMouseMove events.