Jump to content
  • Advertisement
Sign in to follow this  
Galaximo

Mouse hidden but still can click 'X'

This topic is 4265 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!