Jump to content
  • Advertisement
Sign in to follow this  
Pyotr

Hiding the Mouse Cursor with DXUT while in Windowed Mode?

This topic is 3953 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

Hi, I have been trying to find an answer to this for quite a while with no luck so I thought I would ask here and on the Microsoft Direct3D boards. If the answer is obvious and I missed it, Im really sorry for the waste of time. I recently switched the game I was working on to DXUT so that certain events would be easier to catch and the code would be easier to read through. The problem I am having, however, is that I want to be able to run in Windowed and Fullscreen mode with a toggle-able mouse cursor. Before using DXUT, this was fairly easy to implement. Now, with DXUT implemented, all I can find how to do is to enable/disable the mouse in Fullscreen mode. When I am in windowed mode, I cannot find any way to prevent the game from making the mouse cursor visible and non-exclusive. I do not want the player to be able to click out of the window on accident and mess things up. If there is any way for me to do this without reverting back to my older code, I would really appreciate the help. Thank you very much.

Share this post


Link to post
Share on other sites
Advertisement
To show/hide the mouse:

ShowCursor(FALSE);

As for not letting the user click outside, you might be able to use the WS_EX_TOPMOST setting in CreateWindowEx

Share this post


Link to post
Share on other sites
Wow... I can't believe I missed ShowCursor. I guess I tried SetCursor(NULL) and was thinking I tried ShowCursor too. Thank you so much for that!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!