Jump to content
  • Advertisement


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


Ignoring ALT-TAB, windows key, etc...

This topic is 6131 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 DirectInput for mouse/keyboard, OpenGL for rendering. My problem is, if my app is running in windowed mode and you either: click the mouse outside the window, press alt-tab, or actually anything that just makes the window lose focus, the app quits out. I''d like to be able to decide if I want to ignore the event (in the case of alt-tab), or handle it in my own way (in the case of lost focus) instead of just immediately quitting. My guess is this has something to do with the PeekMessage event and picking out the proper message. Can anyone help me out? Or perhaps there''s some source code somewhere that I could look at. Thanks =)

Share this post

Link to post
Share on other sites
There are ways to stop alt-tab working, however, i don''t recommend it at all. Instead; lookup the following windows messages:

And process them to track changes to the program becoming activated/minimised/etc.... Also, keep in mind that you should attempt to process errors such as DIERR_INPUTLOST (with DirectInput) anyway, as CTRL-ALT-DEL can sometimes be very annoying.

Share this post

Link to post
Share on other sites

  • 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!