Jump to content
  • Advertisement


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


Making Alt+TAB work

This topic is 6330 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 just can''t get Alt+TAB working. I am using DirectX SDK 7.0a and DirectDraw, DirectSound and DirectInput. What needs to be done when the game looses focuses and what needs to be done when it regains it? Under which message should I add my code (WM_LOSTFOCUS or WM_ACTIVATEAPP or something else?). Johan Torp - http://www.destruction.nu

Share this post

Link to post
Share on other sites
If you scroll down the topics page there''s a thread, something like "Alt-Tab and Ctrl-Esc". If you go there, I answered the guys question. If you''re making a game where it''s important that the game pauses when the user Alt-Tabs, you can do something like this in WndProc():

case WM_KILLFOCUS: // we''ve lost focus
return FALSE;

case WM_SETFOCUS: // we''ve regained it
return FALSE;

That''s what I do and it works peachy. If something''s not clear, just ask. Later.

"We are the music makers, and we are the dreamers of the dreams."
- Willy Wonka

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!