Sign in to follow this  
clearz

Mose position out after screen minimise

Recommended Posts

clearz    157
Hi I have just learned how to restore the direct3d device after minimising a game. I have a problem where the mouse coordinate system seems to be out when I maximise the game again. I an using win messages for my mouse control and not DirectInput here is an example of what im talking abaout http://www.unrealfreaks.com/so.jpg the top graphic is when I run the game for the first time. As you can see the cursor graphic im using for the game is lined up properly with the windows cursor and it is reading the correct position The bottom graphic is after I minimise and maximise the game again. As you can see now the windows cursor is out of line with the bitmap cursor and it is reading a y corrdinate of zero even though its a few pixels from the top of the screen. If I move above this point the WM_MOUSEMOVE message stops getting passed so the bitmap cursor gets stuck. Also at any stage in the game in full screen mode if I click the top left hand corner of the screen the window behind the game gets focus.

Share this post


Link to post
Share on other sites
clearz    157
I figured out what it is but dont know how to resolve it. Even though after I maximise the screen I see the game in full screen the windows messaging system is treating it like its in full screen windowed mode so when I move the mouse to the top of the screen, Windows sees it as being over the application title bar and so stops sending messages to the window. It even closes the app when I click the top right where the X is even though I cant see it.

Any Ideas
Thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this