[c++] Get / Set Cursor position

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
Code:
POINT mousePos;
GetCursorPos(&mousePos);
// work with mousePos.x ,mousePos.y

POINT setPoint = {100,100};
SetCursorPos(&setPoint);
idk

maybe a bit different, its from brain

but btw why not use google u lazy shit
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
user88 said:
Code:
POINT mousePos;
GetCursorPos(&mousePos);
// work with mousePos.x ,mousePos.y

POINT setPoint = {100,100};
SetCursorPos(&setPoint);
idk

maybe a bit different, its from brain

but btw why not use google u lazy shit

I use google , but i just started learn c++ and you attacking me...
Anyway thanks  :not bad:

PHP:
#include <windows.h>
#include <winuser.h>
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{

POINT Cursor;
while (true){

GetCursorPos(&Cursor);
cout << "The cursor x is: " << Cursor.x << " and y is: " << Cursor.y << endl;
    }

system("pause");

}
 

user88

Well-known member
Joined
Jun 29, 2017
Messages
426
Reaction score
165
Location
LINK CLEO DICE HACK HERE!
first thing u wanna know
if u want learn it really

1. lesson: dont ask too much, like this easy things are in the basics so ..
asking too much will not help to understand code etc.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
user88 said:
first thing u wanna know
if u want learn it really

1. lesson: dont ask too much, like this easy things are in the basics so ..
asking too much will not help to understand code etc.

Next question , how to get active window position?
@user88
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,486
Reaction score
227
Location
( ͡° ͜ʖ ͡°)
Parazitas said:
user88 said:
first thing u wanna know
if u want learn it really

1. lesson: dont ask too much, like this easy things are in the basics so ..
asking too much will not help to understand code etc.

Next question , how to get active window position?
@user88

http://lmgtfy.com/?q=how+to+get+active+window+position+c%2B%2B%3F
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
user88 said:
WTF 1.st link in google
wtf

dont ask anymore pls
u will not learn it

You sure?

Window Size.:
PHP:
RECT rect;
 if (GetWindowRect(OSRS, &rect))
{
int width = rect.right - rect.left;
int height = rect.bottom - rect.top;
cout << "The width is: " << width << " and height is: " << height << endl;
}

Window Coords.:
PHP:
RECT rect;
 if (GetWindowRect(OSRS, &rect))
{
int X = rect.left;
int Y =rect.top;
cout << "The Xcoords is: " << X << " and Ycoords is: " << Y << endl;
}
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Opcode.eXe said:
Parazitas said:
user88 said:
first thing u wanna know
if u want learn it really

1. lesson: dont ask too much, like this easy things are in the basics so ..
asking too much will not help to understand code etc.

Next question , how to get active window position?
@user88

http://lmgtfy.com/?q=how+to+get+active+window+position+c%2B%2B%3F

You know this best...

So i have window coordinates , i wanna put mouse in window center - how i should calculate it?
 
Top