Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


moving the mouse within a program?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Electron   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 December 1999 - 02:28 PM

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




Sponsor:

#2 Stark   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 December 1999 - 06:33 AM

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...


#3 Facehat   Members   -  Reputation: 696

Like
Likes
Like

Posted 14 December 1999 - 02:28 PM

Use SetCursorPos(x, y). Simple, eh? By the way, MSDN is a really good resource for this sort of stuff.

--TheGoop


#4 Starfall   Members   -  Reputation: 122

Like
Likes
Like

Posted 14 December 1999 - 02:28 PM

You might want to just use the Win32 function SetCursorPos.

Regards

Starfall





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS