Advertisement

moving the mouse within a program?

Started by December 14, 1999 08:28 PM
2 comments, last by Electron 25 years ago
Not sure what exactly you're asking here.

If you want to track the position of the mouse pointer, just capture the WM_MOUSEMOVE event in your message loop. The X position will be in the LOWORD portion of lParam, and the Y position will be in the HIWORD portion of lParam.

If you're trying to move the mouse to a specific co-ordinate, you might want to investigate using the following:

::PostMessage(hWnd, WM_MOUSEMOVE, 0, MAKELPARAM(xPos,yPos));

I'm not sure how well that will work, if at all though. So, if anybody else has a better suggestion...

Is there anyone who know how to manipulate the mouse coordinates with a program? (in Windows, of course)

------------------
Electron

"Who need more than 64kb of RAM?" -Bill gates -89


--Electron"The truth can be changed simply by the way you accept it.""'General failure trying to read from file' - who is General Failure, and why is he reading my file??"
Advertisement
Use SetCursorPos(x, y). Simple, eh? By the way, MSDN is a really good resource for this sort of stuff.

--TheGoop

You might want to just use the Win32 function SetCursorPos.

Regards

Starfall

This topic is closed to new replies.

Advertisement