Archived

This topic is now archived and is closed to further replies.

Coufu

DirectInput, Mouse Cursor

Recommended Posts

I posted this yesterday in the beginners forum, then I realized there was a DirectX forum so I''m reposting here, because it''s more related to DirectX. Anyway... If I have a custom cursor in my game, how do I get rid of the windows mouse cursor while my window has focus in windowed mode? It''s annoying when you move the mouse outside of the window area and then click somewhere else, then your program loses focus because you *accidently* click on a different window. I tried messing around with the exclusive cooperative levels but the cursor is still there, and hiding the cursor doesn''t help because that only makes the cursor go away while the cursor is over the window. I''m sure this is a pretty common problem... I''ve searched all over google and msdn too and couldn''t find anything, so I''m hoping one of you guys might know... Thanks in advance.

Share this post


Link to post
Share on other sites
When you call SetCooperativeLevel, use DISCL_EXCLUSIVE and DISCL_FOREGROUND. That should get rid of the Windows cursor when your app is in the foreground. The best way to see this effect is with the DirectInput sample "Mouse" in the DirectX SDK.

Share this post


Link to post
Share on other sites
Ah, I tried that already, and it worked rather well, but every time I alt-tab out and alt-tab back in, my game would stop rendering graphics. *boggle* I''m going to look through the project files in the SDK samples, but anyone have any immediate idea why this might be happening?

Share this post


Link to post
Share on other sites