Mouse_Event strange behavior.

Posts 1–15 of 21 · Page 1 of 2
Mouse_Event strange behavior.
So i got going on my Color aimbot. so far everything is going good, but one thing which confuses me is this:

As you can see on the picture, the function i used returns the Tx Ty (wide and high) which is my resolution, though when i make two int's (X and Y) and set their values to the half of Tx and Ty, then to use them in the mouse even function, it should(after all i know) set my mouse position to the middle of my screen, but instead it moves down to the right corner of my screen ....

So, I'm guessing it's cause i use it wrong? I should be doing:
Code:
mouse_event(MOUSEEVENTF_RIGHT, x, y, 0, 0);
&
Code:
mouse_event(MOUSEEVENTF_LEFT, x, y, 0, 0);
For some strange reason, the LEFT and RIGHT (Yea, the parameters don't look like that) does not really move my mouse, at all.

Anyways, enough talking here's my code:
Code:
#include <cstdlib>
#include <iostream>
#include <windows.h>
using namespace std;

int main()
{
   int Tx = GetSystemMetrics(SM_CXSCREEN);
   int Ty = GetSystemMetrics(SM_CYSCREEN);
   
   int x = Tx / 2;
   int y = Ty / 2;
   cout << x << " x - y " << y << endl;
   cout << Tx << " Tx - Ty " << Ty;
mouse_event(MOUSEEVENTF_MOVE, x, y, 0, 0);

    cin.get();
    return EXIT_SUCCESS;
}
Use the flag MOUSEEVENTF_ABSOLUTE to let the function know you want to set the exact position of the mouse.
Quote Originally Posted by mmbob View Post
Use the flag MOUSEEVENTF_ABSOLUTE to let the function know you want to set the exact position of the mouse.
Thanks mate. Gonna try it later today. Will let you know if it works.

Also, is anyone able to find proper documentations of the MOUSE_EVENT. I can't, all i get is problem related searches.
Quote Originally Posted by VirtualDUDE View Post
Thanks mate. Gonna try it later today. Will let you know if it works.

Also, is anyone able to find proper documentations of the MOUSE_EVENT. I can't, all i get is problem related searches.
mymy, I found a secret underground site that can read your mind:

Quote Originally Posted by freedompeace View Post


mymy, I found a secret underground site that can read your mind:

It shows results for VB Windows API's...Etc.

@master131 lol, /Facepalm. Completely forgot about that
Quote Originally Posted by VirtualDUDE View Post
It shows results for VB Windows API's...Etc.

@master131 lol, /Facepalm. Completely forgot about that
So you don't need any help anymore?
Quote Originally Posted by Nathan View Post


So you don't need any help anymore?
Actually, I'm pretty sure i do
I'm going to try with the other "flag" he posted, by a few seconds ago when i tried. I didn't work....Not surprising tho :P
It still doesn't work?
Quote Originally Posted by Stephen View Post
It still doesn't work?
Nope MOUSEEVENTF_ABSOLUTE Doesn't move my mouse.

Off topic, you miss-spelled "you're" in your signature.
Quote Originally Posted by VirtualDUDE View Post
Off topic, you miss-spelled "you're" in your signature.
Your not Serious right ?
Quote Originally Posted by whit View Post
Your not Serious right ?
You did it again
It's You're. You're , YOU ARE. Your, Your object or belonging.

@Hell_Demon Will try the code, thanks. I'm aware the "strange behavior" is caused by the fact it's my first time using these Win functions, so bare with me while i slowly figure it out .
Quote Originally Posted by VirtualDUDE View Post
You did it again
It's You're. You're , YOU ARE. Your, Your object or belonging.

@Hell_Demon Will try the code, thanks. I'm aware the "strange behavior" is caused by the fact it's my first time using these Win functions, so bare with me while i slowly figure it out .
He knows
Quote Originally Posted by Nathan View Post


He knows
I don't wanna sound all stupid But it's still not working correctly.
This time it moves to upper left corner (Y-aks) O__o
I tried legit coordinates like x 400 and y 300..
Can anyone give me an example or perhaps test it themselves :?
Else, thanks for the help.
Code:
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, x, y, 0, 0);
Si?
Posts 1–15 of 21 · Page 1 of 2

Post a Reply

Tags for this Thread

None

Talk with us