Use the flag MOUSEEVENTF_ABSOLUTE to let the function know you want to set the exact position of the mouse.
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);
For some strange reason, the LEFT and RIGHT (Yea, the parameters don't look like that) does not really move my mouse, at all.Code:mouse_event(MOUSEEVENTF_LEFT, x, y, 0, 0);
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; }
Last edited by VirtualDUDE; 05-09-2011 at 09:35 AM.
Use the flag MOUSEEVENTF_ABSOLUTE to let the function know you want to set the exact position of the mouse.
Hell_Demon (05-10-2011)
Hell_Demon (05-10-2011)
*cough* MSDN.
Donate:
BTC: 1GEny3y5tsYfw8E8A45upK6PKVAEcUDNv9
Handy Tools/Hacks:
Extreme Injector v3.7.3
A powerful and advanced injector in a simple GUI.
Can scramble DLLs on injection making them harder to detect and even make detected hacks work again!
Minion Since: 13th January 2011
Moderator Since: 6th May 2011
Global Moderator Since: 29th April 2012
Super User/Unknown Since: 23rd July 2013
'Game Hacking' Team Since: 30th July 2013
--My Art--
[Roxas - Pixel Art, WIP]
[Natsu - Drawn]
[Natsu - Coloured]
All drawings are coloured using Photoshop.
--Gifts--
[Kyle]
Hell_Demon (05-10-2011)
It shows results for VB Windows API's...Etc.
@master131 lol, /Facepalm. Completely forgot about that
It still doesn't work?
Si?Code:mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, x, y, 0, 0);
Ah we-a blaze the fyah, make it bun dem!
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 .
Last edited by VirtualDUDE; 05-10-2011 at 01:48 PM.