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
Solved

Where is the mouse in X,Y form coordinates?

Posted on 1997-12-13
2
386 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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

840 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