mouse input question

Started by
19 comments, last by omegasyphon 22 years, 9 months ago
It does?! I've never heard of that happening, even when DirectInput happens to be initialized in the same app, because it's one of those functions that's always safe to call. Are you positive that it's GetCursorPos that's causing the crash?

This is the code I've used to get the mouse position relative to the origin of my game window's client area:

  // this bit just gets the mouse position in screen coordinatesPOINT curr_pos;GetCursorPos(&curr_pos);// hwnd is the handle to my game's main window// this function will transform the screen coordinates of the mouse to window coordinatesScreenToClient(hwnd, &curr_pos);  


That should do it right there, and it should always be safe to do, assuming that your window has been created prior to the call and you give ScreenToClient a valid window handle.

If you're still having problems, perhaps you could post some code?


Edited by - merlin9x9 on July 12, 2001 3:53:13 PM

This topic is closed to new replies.

Advertisement