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

x
?
Solved

Mouse cursor position functions

Posted on 1998-09-01
5
Medium Priority
?
173 Views
Last Modified: 2010-05-18
Hi.
What are Delphi functions equivalent
to C++ GetCursorPos and SetCursorPos?
thanks
0
Comment
Question by:duke_n
  • 3
5 Comments
 
LVL 5

Expert Comment

by:Tom Knowlton
ID: 1338403
I don't have Delphi in front of me right now, but I know that most components should have an OnMouseMove event under the EVENTS tab in the Object Inspector.  Among the parameters passed in to this procedure are an X and Y which represent the X and Y positon of the cursor, either respective to the form or the component.

As far as SetCursorPos in Delphi...if I had my help in front of me...darn.
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1338404
var
  Pt : TPoint;
begin
  GetCursorPos(pt);
  ShowMessage('X-Coord'+IntToStr(pt.x)+', Y-Coord'+IntToStr(pt.y));//Display coordinates
  SetCursorPos(pt);//if mouse have moved it will return it to the same place as before
end;

I don't know how to implement the TPoint in C++...maybe something like this...This is for Builder C++ , right?

POINT pt;
{
  GetCursorPos(pt);
  SetCursorPos(pt);
}

0
 
LVL 10

Expert Comment

by:viktornet
ID: 1338405
I mean .....still not sure if this is the way C++ implements Point variable

{
  POINT pt;
    GetCursorPos(pt);
    SetCursorPos(pt);
}

If you have other questions ask ;-)

Regards,
Viktor Ivanov
0
 
LVL 1

Author Comment

by:duke_n
ID: 1338406
Thanks Viktor!
that works fine.
0
 
LVL 10

Accepted Solution

by:
viktornet earned 0 total points
ID: 1338407
Ok, great
Still if you have any other questions just ask ;-)

Regards,
Viktor Ivanov
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

886 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