Where is the mouse in X,Y form coordinates?

Delphi 1.0:

How do I determine the location of the mouse pointer in x,y FORM coordinates?  I see there is a Getcursorpos WinAPI function, however I can't make sense out of it.  I don't want a TPoint value returned...instead, I need the X and I need the Y values separately.
Who is Participating?
chrbConnect With a Mentor Commented:
A TPoint value contains both the X and Y coordinates.


 MouseCoordinate: TPoint;
 X, Y: Integer;
 GetCursorPos( MouseCoordinate);
 X:= MouseCoordinate.X;
 Y:= MouseCoordinate.Y;

If you dosn't understand, just comment it.

With best regards
 Christian Bøhn
KapustaAuthor Commented:
Thank you Christian for your assistance.  Your example is excellent.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.