Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Finding Mouse coords?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Lorrenzo
Moderator
Reputation: 4

Joined: 02 Jun 2006
Posts: 3744

PostPosted: Mon Nov 19, 2007 12:26 pm    Post subject: Finding Mouse coords? Reply with quote

How would I come across finding the exact location of my pointer with a click?

Are there any programs that will do this, or do I have to make my own?

If I have to make my own, can I do this in Delphi? If so what coding would I use? Razz

_________________
LAWLrrenzolicious
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Mon Nov 19, 2007 12:34 pm    Post subject: Reply with quote

Load up AC Tools, then hit Ctrl + M, when you have your mouse where you want it.

Or, in C# (I don't know Delphi well enough to know about the mouse-coords)

Drop a button on your form:

Code:

private void button1_Click(object sender, EventArgs e)
{
    MessageBox.Show("X : " + MousePosition.X.ToString() + "\r\n" +
             "Y : " + MousePosition.Y.ToString());
}


Then, run it, hit tab to select the button, move your mouse to the desired spot, and hit enter.

A message box should pop up telling you the coordinates.

Edit:

GEWGLE!!!

Code:

//Source : http://www.scalabium.com/faq/dct0077.htm
var
  P: TPoint;
begin
  GetCursorPos(P);
  yourPopupMenu.Popup(P.X, P.Y);
end;


Code:

//Source : http://www.delphitricks.com/source-code/forms/get_and_set_mouse_position.html
procedure TForm1.Button1Click(Sender: TObject);
var
  MausPos: TPoint;
begin
  GetCursorPos(MausPos);
  label1.Caption := IntToStr(MausPos.x);
  label2.Caption := IntToStr(MausPos.y);
end;


Code:

//Source : http://discuss.fogcreek.com/delphi/default.asp?cmd=show&ixPost=121&ixReplies=2
procedure TForm1.FormMouseMove(Sender: TObject;
                              Shift: TShiftState;
                              X,Y: Integer);

var MyPoint : TPoint;

begin
  Label1.Caption:=IntToStr(X);
  Label2.Caption:=IntToStr(Y); // X, Y  on the form.
  GetCursorPos(MyPoint);
  Label3.Caption:=IntToStr(MyPoint.X);
  Label4.Caption:=IntToStr(MyPoint.Y);  X, Y on screen
end;


Try Googl'ing next time
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites