Lorrenzo Moderator
Reputation: 4
Joined: 02 Jun 2006 Posts: 3744
|
|
samuri25404 Grandmaster Cheater
Reputation: 7
Joined: 04 May 2007 Posts: 955 Location: Why do you care?
|
Posted: Mon Nov 19, 2007 12:34 pm Post subject: |
|
|
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
|
|