Task

Get the current location of the mouse cursor relative to the active window.

Please specify if the window may be externally created.




procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
begin
   lblMousePosition.Caption := ('X:' + IntToStr(X) + ', Y:' + IntToStr(Y));
end;