Recommended Posts

Currently have an application that I want to make possible to be windowed instead of fullscreen. Problem being that the GetCursorPos() grabs the fullscreen's position of the mouse. Have tried to offset this by using the GetWindowRect() but this only corrects to the point of the window, so the mouse position is still out by the border of the window. Is there a way to still use this method of grabbing the mouse position but correcting it to the positioning of the window's display frame?

Share this post

Link to post

Share on other sites

GetClientRect seems to be returning the dimensions of the frame...as in the left is always at 0 and the right is always (in this example) 632. Does not give its position over the screen..or even compared to its own window.

Share this post

Link to post

Share on other sites

Oh and it had/has to do with DirectInput because DirectInput is being used for the keyboard and the mouse clicks (at moment) Also the mouses movement used to be checked by DI, just had not realised that I had moved it completely under the Win API code.

0

Share this post

Link to post

Share on other sites

Oh and it had/has to do with DirectInput because DirectInput is being used for the keyboard and the mouse clicks (at moment) Also the mouses movement used to be checked by DI, just had not realised that I had moved it completely under the Win API code.

A little off topic, but Microsoft actually recommends against using DirectInput for keyboard and mouse input. The Win32 functions work better for keyboard input (Since you don't have to do the upper to lower case transition and so on) and mouse input (Pointer ballistics).

0

Share this post

Link to post

Share on other sites

Current program is regarding mostly 2D board games and the such, where uppercase/lowercase will not be an issue at any point. (At present moment the keyboard itself has very little to do with it as well, *point, click, point, click*).