Solved

Where is the mouse in X,Y form coordinates?

Posted on 1997-12-13
2
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Accepted Solution

by:
chrb earned 50 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

636 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