Working with Cursors
| Legacy, Delphi and Other Languages Discuss, Working with Cursors at Programmers Lounge forum; ~Setting Cursor Position
SetCursorPos(x,y);
~Getting Cursor Position
var
MyPoint: TPoint; // our point to be recieving the X and Y's
... |
| Notices | Welcome to the Gamerz Needs forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |  | 
08-01-2008, 06:30 PM
|  | All Hope is Gone! | | | Last Online: Today 06:53 PM Join Date: Nov 2006 Location: Location:
Posts: 2,058
Thanks: 230
Thanked 221 Times in 145 Posts
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 1 Uploads: 0
Latest Blog:
Rep Power: 11 Points: 1,052.50 Bank: 112,046.35 Total Points: 113,098.85 | | | Working with Cursors
~Setting Cursor Position ~Getting Cursor Position Quote:
var
MyPoint: TPoint; // our point to be recieving the X and Y's
X,Y: integer; //Convert so the code is less Messy
begin
GetCursorPos(MyPoint); //YUM!
X := MyPoint.X; //Coverting..
Y := MyPoint.Y; //Coverting..
| Getting To Display your Cursor Position
(In a Timer)! MS: 50 Quote:
var
MyPoint: TPoint; // our point to be recieving the X and Y's
X,Y: integer; //Convert so the code is less Messy
begin
GetCursorPos(MyPoint); //YUM!
X := MyPoint.X; //Coverting..
Y := MyPoint.Y; //Coverting..
Edit1.Text := IntToStr(X);
Edit2.Text := IntToStr(Y);
| ~Cursor Clicks
PostMessage Quote:
var
MyPoint: TPoint;
X,Y: integer;
begin
GetCursorPos(MyPoint); //YUM!
X := MyPoint.X; //Coverting..
Y := MyPoint.Y; //Coverting..
PostMessage(GetWindowDC(GetDesktopWindow),WM_LBUTT ONDBLCLK,MK_LBUTTON,MakeLong(X,Y));
sleep(100); //Like a Normal Mouse click
| Mouse Event Quote:
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, X, Y, 0, 0);
sleep(100);
Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
|
Thats about all o.o
__________________ Quote: |
Originally Posted by Nuclear Bomb, The Legend, xDiamond, GzNPrize, iPromise, Aduka I mastered vb in 1 month | | 
08-03-2008, 11:36 AM
|  | I love GzN! | | | Last Online: 09-09-2008 03:57 PM Join Date: Jul 2007
Posts: 1,672
Thanks: 87
Thanked 119 Times in 84 Posts
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 0 Uploads: 0
Latest Blog: Oh
Rep Power: 9 Points: 1,883.10 Bank: 135.15 Total Points: 2,018.25 | | |
Then you shouldn't be programming, and spamming in here. Also if you came here you would have noticed this is the DELPHI section.
__________________
I Love Gzn. www.iGzN.com
| 
08-03-2008, 11:56 AM
|  | Double Wood Axe | | | Last Online: 10-20-2008 08:13 AM Join Date: Mar 2007
Posts: 27
Thanks: 7
Thanked 1 Time in 1 Post
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 15 Uploads: 0
Latest Blog:
Rep Power: 0 Points: 3,669.90 Bank: 0.00 Total Points: 3,669.90 | | Quote:
Originally Posted by Beast Then you shouldn't be programming, and spamming in here. Also if you came here you would have noticed this is the DELPHI section. | i get a link from my orginel post to look here so i look and i ask if i dont ask i never know it its not spam its a question Auto klikker
Last edited by marco1784; 08-03-2008 at 11:59 AM..
| 
08-03-2008, 12:00 PM
|  | blahh! | | | Last Online: 01-04-2009 10:38 PM Join Date: Jan 2007 Location: California
Posts: 732
Thanks: 141
Thanked 95 Times in 50 Posts
Nominated 6 Times in 3 Posts TOTW/F/M Award(s): 0 Downloads: 3 Uploads: 0
Latest Blog: blahh!!!
Rep Power: 6 Points: 833.70 Bank: 100,872.89 Total Points: 101,706.59 | | Quote:
Originally Posted by marco1784 i get a link from my orginel post to look here so i look and i ask if i dont ask i never know it its not spam its a question Auto klikker | i gave you that link cause i thought you would be smart enough to convert it to C++ yourself.
| 
08-03-2008, 12:08 PM
|  | Double Wood Axe | | | Last Online: 10-20-2008 08:13 AM Join Date: Mar 2007
Posts: 27
Thanks: 7
Thanked 1 Time in 1 Post
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 15 Uploads: 0
Latest Blog:
Rep Power: 0 Points: 3,669.90 Bank: 0.00 Total Points: 3,669.90 | | |
i dont have any idee what this all mean if some 1 explain to me simpel step by step maby i can make t i have never did a program befor im a noob whis code's :S
but im not lazy to let other people make it when i can learn it if some 1 explain it to me
i want only make my mouse klik on 3 space's every 2 min x908 y555
x435 y620 x502 y661 can u help me explain or make 1 for me both will help me greets from me
| 
08-04-2008, 09:39 PM
| | Double Wood Axe | | | Last Online: Today 08:58 PM Join Date: Aug 2008
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 0 Uploads: 0
Latest Blog:
Rep Power: 0 Points: 973.00 Bank: 0.00 Total Points: 973.00 | |
You're assigning the same thing twice here: Code: var
MyPoint: TPoint; // our point to be recieving the X and Y's
X,Y: integer; //Convert so the code is less Messy
begin
GetCursorPos(MyPoint); //YUM!
X := MyPoint.X; //Coverting..
Y := MyPoint.Y; //Coverting..
Edit1.Text := IntToStr(X);
Edit2.Text := IntToStr(Y);
I know you said it was to keep the code less messy looking but reassigning like that is bad practice. I'm just pointing it out for somebody who might not know it. Code: var
MyPoint: TPoint; // our point to be recieving the X and Y's
begin
GetCursorPos(MyPoint); //YUM!
Edit1.Text := IntToStr(MyPoint.X);
Edit2.Text := IntToStr(MyPoint.Y);
| 
08-22-2008, 01:18 PM
| | Immortal Beast | | | Last Online: 11-13-2008 04:06 PM Join Date: Aug 2008 Location: Stalkers..
Posts: 349
Thanks: 125
Thanked 80 Times in 44 Posts
Nominated 1 Time in 1 Post TOTW/F/M Award(s): 0 Downloads: 0 Uploads: 0
Latest Blog: Vacation to IRAQ, and Kuwait.
Rep Power: 0 Points: 1,352.60 Bank: 22,980.07 Total Points: 24,332.67 | | |
Lol, nie thread... do ypou have a source?
| 
08-22-2008, 01:19 PM
| | Double Wood Axe | | | Last Online: Today 08:58 PM Join Date: Aug 2008
Posts: 23
Thanks: 0
Thanked 1 Time in 1 Post
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 0 Uploads: 0
Latest Blog:
Rep Power: 0 Points: 973.00 Bank: 0.00 Total Points: 973.00 | | |
The source is in front of your face. Use it.
| 
08-22-2008, 06:21 PM
|  | All Hope is Gone! | | | Last Online: Today 06:53 PM Join Date: Nov 2006 Location: Location:
Posts: 2,058
Thanks: 230
Thanked 221 Times in 145 Posts
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 1 Uploads: 0
Latest Blog:
Rep Power: 11 Points: 1,052.50 Bank: 112,046.35 Total Points: 113,098.85 | | |
lol ok, meh. I like the way of assigning the x & y of the points to the Tpoints, makes it less messy for me in the. Your way also works, i guess people have opinons of there own when it comes to programming rofl
__________________ Quote: |
Originally Posted by Nuclear Bomb, The Legend, xDiamond, GzNPrize, iPromise, Aduka I mastered vb in 1 month | | 
08-24-2008, 04:11 PM
|  | Double Wood Axe | | | Last Online: 10-22-2008 10:37 AM Join Date: Aug 2008
Posts: 29
Thanks: 0
Thanked 3 Times in 3 Posts
Nominated 0 Times in 0 Posts TOTW/F/M Award(s): 0 Downloads: 0 Uploads: 0
Latest Blog:
Rep Power: 0 Points: 495.30 Bank: 0.00 Total Points: 495.30 | | |
Thanks, i needed this alot.
|  | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | |