Jump to content

  • Log In with Google      Sign In   
  • Create Account


Alt-Tabability


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 LackOfKnack   Members   -  Reputation: 122

Like
Likes
Like

Posted 10 December 1999 - 02:34 AM

Here's a newbie question for ya:

How do you make your DirectX app alt-tabable? Can you explain how to do it in VB or at least the general concept?

Thanks.

------------------

Lack


Sponsor:

#2 mason   Members   -  Reputation: 128

Like
Likes
Like

Posted 09 December 1999 - 02:18 PM

In a nutshell... when you gain or lose focus (WM_ACTIVATE), you release / recreate the DirectDraw interface and all the surfaces.

Mason McCuskey
Spin Studios
www.spin-studios.com

[This message has been edited by mason (edited December 09, 1999).]


#3 Teej   GDNet+   -  Reputation: 176

Like
Likes
Like

Posted 10 December 1999 - 02:34 AM

In a typical C game, people usually have a BOOLean that is TRUE when the game is in the foreground, and FALSE otherwise. So in a typical loop it may look like:

while (TRUE)
{
if(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
{
if (msg.message == WM_QUIT) break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
else if (bActive) // <--------
{
UpdateFrame;
}


Where to set the flag? Windows sends a WM_ACTIVATE message when your program is activated or deactivated...set the flag there.

case WM_ACTIVATE:
bActive = !((BOOL)HIWORD(wParam));
return 0L;

Teej





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS