|
Cheat Engine The Official Site of Cheat Engine
|
View previous topic :: View next topic |
Author |
Message |
x_maddog_x How do I cheat? Reputation: 0
Joined: 14 Feb 2017 Posts: 2
|
Posted: Tue Feb 28, 2017 11:47 pm Post subject: move mouse in game X,Y |
|
|
i need help in my code, dont working!
internal const int WM_MOUSEMOVE = 0x200;
[DllImport("User32.dll")]
public static extern Int32 FindWindow(String lpClassName, String lpWindowName);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SendMessage(int hWnd, int msg, int wParam, IntPtr lParam);
private void button1_Click(object sender, EventArgs e)
{
int hwnd = FindWindow(null, "game");
int PosX = 300;
int PosY = 300;
SendMessage((int)hwnd, WM_MOUSEMOVE, PosX, IntPtr.Zero);
SendMessage((int)hwnd, WM_MOUSEMOVE, PosY, IntPtr.Zero);
}
NOT WORKING... this code put my mouse in top!
i need put real X , Y direction
|
|
Back to top |
|
|
Viloresi Expert Cheater Reputation: 0
Joined: 02 Feb 2017 Posts: 149
|
Posted: Wed Mar 01, 2017 3:06 am Post subject: |
|
|
ChangeWM_MOUSEMOVE = 0x200;
To WM_MOUSEMOVE = 0x01;
The problem is that you are trying to move the mouse inside a game that maybe is an fps or a game where the view of the player is stick with the mouse cursor, so you can't move the mouse cursor since it will be blocked in the middle of the screen with the eventual weapon crosshair,
If you try to move it to a coordinate of the screen, if you use that function windows tries to move the mouse to these coordinates but ot never reaches them.
I've told you to use 0x01, after looking inside msdn I've seen maybe that's the parameter you should use. Aniway I hope you get the idea since I'm tyling from my phone I can't help you much:S
|
|
Back to top |
|
|
atom0s Moderator Reputation: 198
Joined: 25 Jan 2006 Posts: 8518 Location: 127.0.0.1
|
Posted: Thu Mar 02, 2017 3:31 am Post subject: |
|
|
Not every game reacts to input the same. You may need to use something else such as SendInput, or if the game uses DirectInput, you may have to actually hook the input handling and manipulate it entirely yourself.
_________________
- Retired. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|