The following example demonstrates how to use the OnAppMouseDown, OnAppMouseUp and OnAppMouseMove events of the acAppEvents component.
procedure TForm1.acAppEvents1AppMouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; ScreenPoint: TPoint;
WindowHandle, HitTestCode: Integer);
var
MouseButton: String;
begin
case Button of
mbLeft: MouseButton := 'Left';
mbRight: MouseButton := 'Right';
mbMiddle: MouseButton := 'Middle';
end;
Memo1.Lines.Add(MouseButton + ' button down: ' +
IntToStr(ScreenPoint.X) + ':' + IntToStr(ScreenPoint.Y) +
', Handle: ' + IntToStr(WindowHandle) + ', HitTest code: ' + IntToStr(HitTestCode));
end;
procedure TForm1.acAppEvents1AppMouseUp(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; ScreenPoint: TPoint;
WindowHandle, HitTestCode: Integer);
var
MouseButton: String;
begin
case Button of
mbLeft: MouseButton := 'Left';
mbRight: MouseButton := 'Right';
mbMiddle: MouseButton := 'Middle';
end;
Memo1.Lines.Add(MouseButton + ' button up: ' +
IntToStr(ScreenPoint.X) + ':' + IntToStr(ScreenPoint.Y) +
', Handle: ' + IntToStr(WindowHandle) + ', HitTest code: ' + IntToStr(HitTestCode));
end;