Jump to content
  • Advertisement

Archived

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

thorpe

Making Alt+TAB work

This topic is 6150 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
Advertisement
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
Paused=TRUE;
return FALSE;

case WM_SETFOCUS: // we''ve regained it
Paused=FALSE;
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!