Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Where is the mouse in X,Y form coordinates?

Posted on 1997-12-13
2
Medium Priority
?
396 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:Kapusta
2 Comments
 

Accepted Solution

by:
chrb earned 200 total points
ID: 1353552
A TPoint value contains both the X and Y coordinates.

ex.

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

If you dosn't understand, just comment it.

With best regards
 Christian Bøhn
0
 

Author Comment

by:Kapusta
ID: 1353553
Thank you Christian for your assistance.  Your example is excellent.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Screencast - Getting to Know the Pipeline
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question