?
Solved

Where is the mouse in X,Y form coordinates?

Posted on 1997-12-13
2
Medium Priority
?
393 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 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

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

718 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