GetCursorPos(&p) problem

Posts 1–15 of 21 · Page 1 of 2
GetCursorPos(&p) problem
I'm using it to find the x.y position for an afk bot, and it has worked in the past, but now it won't work while I'm running CA.


Anyone know why?

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

using namespace std;

int main()
{
POINT p;

while(true)
{
if(GetAsyncKeyState(VK_F7))
{
GetCursorPos(&p);
cout<< " X: " << p.x << " Y: " << p.y <<endl;
}
Sleep(100);
}
}
It's probably blocked. SendInput() works for me.

Oh crap, I thought you meant SetCursorPos, my bad Obama. That's what I get for skimming too fast. ;_;
Make a dll project in MSVC++ with no precompiled headers and put this into your main project. It will get cursor position on F7 and store it into a file

[php]
#include <windows.h>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream iSaveFile("iSaveFile.txt");
string xPos, yPos, iSave;
iSave = "";
POINT Pos;
while(1)
{
if(GetAsyncKeyState(VK_F7))
{
GetCursorPos(&Pos);
xPos = Pos.x;
yPos = Pos.y;
iSave = iSave + xPos + yPos + "\n";
}
iSaveFile << iSave;
Sleep(100);
}
}
[/php]
You must create iSaveFile.txt in the same folder as this dll is located... I tested and it works fine NP
Quote Originally Posted by mwb1234 View Post
Make a dll project in MSVC++ with no precompiled headers and put this into your main project. It will get cursor position on F7 and store it into a file

[php]
#include <windows.h>
#include <fstream>
#include <string>
using namespace std;
int main()
{
fstream iSaveFile("iSaveFile.txt");
string xPos, yPos, iSave;
iSave = "";
POINT Pos;
while(1)
{
if(GetAsyncKeyState(VK_F7))
{
GetCursorPos(&Pos);
xPos = Pos.x;
yPos = Pos.y;
iSave = iSave + xPos + yPos + "\n";
}
iSaveFile << iSave;
Sleep(100);
}
}
[/php]
You must create iSaveFile.txt in the same folder as this dll is located... I tested and it works fine NP
The program I made works, just not through CA. Thats the problem.
This works thru ca
Quote Originally Posted by mwb1234 View Post
This works thru ca
The only difference in how the two act is how they display the coordinates. It's proboably something on my comp screwing it up and nothing with the code.

It might even just be Win7. The last time I used it was when I still had XP.
Tell me what coords u want and I may be able to get em
Quote Originally Posted by mwb1234 View Post
Tell me what coords u want and I may be able to get em
Probable the quick join and back to lobby,
Quote Originally Posted by ac1d_buRn View Post


Probable the quick join and back to lobby,
It's ok. I still have XP installed on one partition, I'll just swap some jumpers and get in to XP.
That is interesting because I have the same thing in my hack and GetCursorPos() works just fine...
isnt there a way to hook without using GetAsyncKeyState? cuz it would make the programs less laggy if people used something else cuz GetAsyncKeyState is a resource hoggggg
Well good luck getting this solved
Quote Originally Posted by cruizrisner View Post
isnt there a way to hook without using GetAsyncKeyState? cuz it would make the programs less laggy if people used something else cuz GetAsyncKeyState is a resource hoggggg
It is?

Your computer must be a shitbox.
Quote Originally Posted by ac1d_buRn View Post


It is?

Your computer must be a shitbox.
Haha, agree on that ;P
Quote Originally Posted by Hell_Demon View Post
Haha, agree on that ;P
Double agreed :O
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us