Jump to content
  • Advertisement
Sign in to follow this  
derek7

window mode and DInput

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

when I use window mode and set mouse SetCooperativeLevel DISCL_EXCLUSIVE or DISCL_FOREGROUND or other ,all is ok I can switch my demo to foreground or background . but if I set SetCooperativeLevel DISCL_EXCLUSIVE|DISCL_FOREGROUND if I switch demo, demo is pause and cannot be switch again? 1.why this problem is relative to the mouse device? 2. if I just set SetCooperativeLevel DISCL_FOREGROUND ,the demo in background but it still acquire the mouse device why?

Share this post


Link to post
Share on other sites
Advertisement
As I'm sure you know, when you have an input device that's in the foreground, it is unacquired when the program loses focus. My first question to you would then be, are you attempting to acquire the device again when you regain focus? If not, that could be your problem.

If you are covering that problem, perhaps another process is trying to take exclusive access of the mouse when your program is in the background, in which case you would be unable to take the device exclusively.

As for your second question, how are you checking the fact that your demo still acquires the mouse when it is in the background? However, if you actually are experiencing this behavior, it might be your problem. When you try to switch back to your demo are you only unable to regain focus to the demo or to any program? If the program still has exclusive access to the mouse while in the background (though, the DX docs say that it can't), no windows mouse messages will be generated and therefore you wouldn't be able to regain focus to any windows program.

Barring that, try using the mouse sample program that comes with the DXSDK and see if you experience the same behavior with their code as you do with yours.

-Jeff

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!