Sign in to follow this  

Mouse hidden but still can click 'X'

This topic is 4075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using C# to make a Managed DirectX game. My problem is even though I have hidden the mouse, using Cursor.Hide, if while in the game i move the mouse towards the top left or top right corner it clicks on the little icons and exits the game. I looked into restricting the mouse to the window area, but couldn't find a way. Any ideas? Thanks

Share this post


Link to post
Share on other sites
I'm not sure about C#, but the process should be similar for C++. In C++ you can just handle WM_CLOSE messages in your window procedure, and tell Windows not to close your window if you're not ready (E.g. you're in game rather than at the main menu).

Share this post


Link to post
Share on other sites

This topic is 4075 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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