Solved

Where is the mouse in X,Y form coordinates?

Posted on 1997-12-13
2
374 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 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now