Thread: [GD-Windows] Alt+Tab in fullscreen with no other apps running
Brought to you by:
vexxed72
From: Oscar C. <oc...@fr...> - 2007-09-04 15:05:34
|
Hi, Does anyone know if there's something I have to do (or avoid doing) to make my game minimise when the player hits Alt+Tab whilst running in fullscreen with no other apps running? My game isn't minimising in pre-Vista versions of Windows, but other games seem to do so. Windows isn't sending me any WM_ACTIVATE or WM_ACTIVATEAPP messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing these on to the default WndProc expecting it to handle any necessary plumbing. With other apps running the Alt+Tab behaviour is correct in fullscreen, but in this case Windows is sending me a completely different sequence of messages. Thanks in advance, Oscar Cooper Lead Programmer Frontier Developments Ltd |
From: Alen L. <ale...@cr...> - 2007-09-04 16:03:14
|
Hi Oscar, IIRC, we've always been doing something like if( (msg.message==WM_ACTIVATE && (LOWORD(msg.wParam)==WA_INACTIVE || HIWORD(msg.wParam))) || msg.message==WM_CANCELMODE || msg.message==WM_KILLFOCUS || (msg.message==WM_ACTIVATEAPP && !msg.wParam)) { if (bInFullScreen) { PostMessage(NULL, WM_SYSCOMMAND, SC_MINIMIZE, 0); } That seems to work for us, YMMV. HTH, Alen Oscar wrote: > Hi, > Does anyone know if there's something I have to do (or avoid doing) to make > my game minimise when the player hits Alt+Tab whilst running in fullscreen > with no other apps running? > My game isn't minimising in pre-Vista versions of Windows, but other games > seem to do so. Windows isn't sending me any WM_ACTIVATE or WM_ACTIVATEAPP > messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing > these on to the default WndProc expecting it to handle any necessary > plumbing. > With other apps running the Alt+Tab behaviour is correct in fullscreen, but > in this case Windows is sending me a completely different sequence of > messages. > Thanks in advance, > Oscar Cooper > Lead Programmer > Frontier Developments Ltd > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 |
From: Oscar C. <oc...@fr...> - 2007-09-06 11:54:20
|
I still haven't got this working, testing under WinXP :-( Alen's idea gets me most of the way there, but my window gets restored immediately after being minimised. Looking through the windows message trace, it looks like the minimise completes successfully: the WM_SYSCOMMAND triggers a bunch of further messages including the WM_ACTIVATE (WA_INACTIVE) and WM_ACTIVATEAPP (wParam=FALSE). However I then immediately get a WM_ACTIVATE (WA_ACTIVE) message, which I assume is generated by Windows in response to certain properties of my window or because I'm not handling some messages correctly. In addition to Alen's code I've also tried experimenting with the window style flags, and even tried calling SetWindowPos to force my window first to the bottom of the z-order and then again to put it back on top, to make sure it's not TOPMOST, but I'm still missing something. I hate working with API's I don't know very well, I feel like such a n00b ;-> Can anyone bail me out? Cheers, Oscar. ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: <gam...@li...> Sent: Tuesday, September 04, 2007 5:03 PM Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running > Hi Oscar, > > IIRC, we've always been doing something like > > if( (msg.message==WM_ACTIVATE && (LOWORD(msg.wParam)==WA_INACTIVE || > HIWORD(msg.wParam))) > || msg.message==WM_CANCELMODE > || msg.message==WM_KILLFOCUS > || (msg.message==WM_ACTIVATEAPP && !msg.wParam)) { > > if (bInFullScreen) { > PostMessage(NULL, WM_SYSCOMMAND, SC_MINIMIZE, 0); > } > > That seems to work for us, YMMV. > > HTH, > Alen > > Oscar wrote: > >> Hi, > >> Does anyone know if there's something I have to do (or avoid doing) to >> make >> my game minimise when the player hits Alt+Tab whilst running in >> fullscreen >> with no other apps running? > >> My game isn't minimising in pre-Vista versions of Windows, but other >> games >> seem to do so. Windows isn't sending me any WM_ACTIVATE or WM_ACTIVATEAPP >> messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing >> these on to the default WndProc expecting it to handle any necessary >> plumbing. > >> With other apps running the Alt+Tab behaviour is correct in fullscreen, >> but >> in this case Windows is sending me a completely different sequence of >> messages. > >> Thanks in advance, > >> Oscar Cooper >> Lead Programmer >> Frontier Developments Ltd > > > >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Gamedevlists-windows mailing list >> Gam...@li... >> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Oscar C. <oc...@fr...> - 2007-09-06 14:27:00
|
Replying to my own post... I eventually got it working by recording the HWND passed with the WM_CANCELMODE message, then next time around my game loop calling ShowWindow( hWnd, SW_MINIMIZE ). This may not be the ideal solution to the problem so I'd still be interested in hearing if there's a better way. Thanks to all who helped, Oscar. ----- Original Message ----- From: "Oscar Cooper" <oc...@fr...> To: "Game Development for MS Windows" <gam...@li...> Sent: Thursday, September 06, 2007 12:54 PM Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running >I still haven't got this working, testing under WinXP :-( > > Alen's idea gets me most of the way there, but my window gets restored > immediately after being minimised. Looking through the windows message > trace, it looks like the minimise completes successfully: the > WM_SYSCOMMAND > triggers a bunch of further messages including the WM_ACTIVATE > (WA_INACTIVE) > and WM_ACTIVATEAPP (wParam=FALSE). However I then immediately get a > WM_ACTIVATE (WA_ACTIVE) message, which I assume is generated by Windows in > response to certain properties of my window or because I'm not handling > some > messages correctly. > > In addition to Alen's code I've also tried experimenting with the window > style flags, and even tried calling SetWindowPos to force my window first > to > the bottom of the z-order and then again to put it back on top, to make > sure > it's not TOPMOST, but I'm still missing something. > > I hate working with API's I don't know very well, I feel like such a n00b > ;-> > > Can anyone bail me out? > > Cheers, > > Oscar. > > > > ----- Original Message ----- > From: "Alen Ladavac" <ale...@cr...> > To: <gam...@li...> > Sent: Tuesday, September 04, 2007 5:03 PM > Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running > > >> Hi Oscar, >> >> IIRC, we've always been doing something like >> >> if( (msg.message==WM_ACTIVATE && (LOWORD(msg.wParam)==WA_INACTIVE || >> HIWORD(msg.wParam))) >> || msg.message==WM_CANCELMODE >> || msg.message==WM_KILLFOCUS >> || (msg.message==WM_ACTIVATEAPP && !msg.wParam)) { >> >> if (bInFullScreen) { >> PostMessage(NULL, WM_SYSCOMMAND, SC_MINIMIZE, 0); >> } >> >> That seems to work for us, YMMV. >> >> HTH, >> Alen >> >> Oscar wrote: >> >>> Hi, >> >>> Does anyone know if there's something I have to do (or avoid doing) to >>> make >>> my game minimise when the player hits Alt+Tab whilst running in >>> fullscreen >>> with no other apps running? >> >>> My game isn't minimising in pre-Vista versions of Windows, but other >>> games >>> seem to do so. Windows isn't sending me any WM_ACTIVATE or >>> WM_ACTIVATEAPP >>> messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing >>> these on to the default WndProc expecting it to handle any necessary >>> plumbing. >> >>> With other apps running the Alt+Tab behaviour is correct in fullscreen, >>> but >>> in this case Windows is sending me a completely different sequence of >>> messages. >> >>> Thanks in advance, >> >>> Oscar Cooper >>> Lead Programmer >>> Frontier Developments Ltd >> >> >> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Gamedevlists-windows mailing list >>> Gam...@li... >>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Gamedevlists-windows mailing list >> Gam...@li... >> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >> > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: Alen L. <ale...@cr...> - 2007-09-06 14:48:21
|
Are you resetting display mode when you receive WM_SYSCOMMAND,SC_MINIMIZE? Also one trick more... in some apps I think I used to set a bool when receiveing a window resize/minimize/maximize command and then just eat all window size related messages without processing them until we empty the queue (no more messages pending). This kills all quirks that Windows throw on you as sideeffects of changing a window size. Alen Oscar wrote: > Replying to my own post... > I eventually got it working by recording the HWND passed with the > WM_CANCELMODE message, then next time around my game loop calling > ShowWindow( hWnd, SW_MINIMIZE ). This may not be the ideal solution to the > problem so I'd still be interested in hearing if there's a better way. > Thanks to all who helped, > Oscar. > ----- Original Message ----- > From: "Oscar Cooper" <oc...@fr...> > To: "Game Development for MS Windows" > <gam...@li...> > Sent: Thursday, September 06, 2007 12:54 PM > Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running >>I still haven't got this working, testing under WinXP >> >> Alen's idea gets me most of the way there, but my window gets restored >> immediately after being minimised. Looking through the windows message >> trace, it looks like the minimise completes successfully: the >> WM_SYSCOMMAND >> triggers a bunch of further messages including the WM_ACTIVATE >> (WA_INACTIVE) >> and WM_ACTIVATEAPP (wParam=FALSE). However I then immediately get a >> WM_ACTIVATE (WA_ACTIVE) message, which I assume is generated by Windows in >> response to certain properties of my window or because I'm not handling >> some >> messages correctly. >> >> In addition to Alen's code I've also tried experimenting with the window >> style flags, and even tried calling SetWindowPos to force my window first >> to >> the bottom of the z-order and then again to put it back on top, to make >> sure >> it's not TOPMOST, but I'm still missing something. >> >> I hate working with API's I don't know very well, I feel like such a n00b >> ;-> >> >> Can anyone bail me out? >> >> Cheers, >> >> Oscar. >> >> >> >> ----- Original Message ----- >> From: "Alen Ladavac" <ale...@cr...> >> To: <gam...@li...> >> Sent: Tuesday, September 04, 2007 5:03 PM >> Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running >> >> >>> Hi Oscar, >>> >>> IIRC, we've always been doing something like >>> >>> if( (msg.message==WM_ACTIVATE && (LOWORD(msg.wParam)==WA_INACTIVE || >>> HIWORD(msg.wParam))) >>> || msg.message==WM_CANCELMODE >>> || msg.message==WM_KILLFOCUS >>> || (msg.message==WM_ACTIVATEAPP && !msg.wParam)) { >>> >>> if (bInFullScreen) { >>> PostMessage(NULL, WM_SYSCOMMAND, SC_MINIMIZE, 0); >>> } >>> >>> That seems to work for us, YMMV. >>> >>> HTH, >>> Alen >>> >>> Oscar wrote: >>> >>>> Hi, >>> >>>> Does anyone know if there's something I have to do (or avoid doing) to >>>> make >>>> my game minimise when the player hits Alt+Tab whilst running in >>>> fullscreen >>>> with no other apps running? >>> >>>> My game isn't minimising in pre-Vista versions of Windows, but other >>>> games >>>> seem to do so. Windows isn't sending me any WM_ACTIVATE or >>>> WM_ACTIVATEAPP >>>> messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing >>>> these on to the default WndProc expecting it to handle any necessary >>>> plumbing. >>> >>>> With other apps running the Alt+Tab behaviour is correct in fullscreen, >>>> but >>>> in this case Windows is sending me a completely different sequence of >>>> messages. >>> >>>> Thanks in advance, >>> >>>> Oscar Cooper >>>> Lead Programmer >>>> Frontier Developments Ltd >>> >>> >>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Splunk Inc. >>>> Still grepping through log files to find problems? Stop. >>>> Now Search log events and configuration files using AJAX and a browser. >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>> _______________________________________________ >>>> Gamedevlists-windows mailing list >>>> Gam...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>>> Archives: >>>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >>> >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Gamedevlists-windows mailing list >>> Gam...@li... >>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >>> >> >> >> >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Gamedevlists-windows mailing list >> Gam...@li... >> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >> > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 -- Alen |
From: Oscar C. <oc...@fr...> - 2007-09-06 16:40:51
|
> Are you resetting display mode when you receive WM_SYSCOMMAND,SC_MINIMIZE? I'm letting the default wndproc handle that message, my actual display is managed with D3D and uses the DEVICELOST error codes to trigger resets without touching the Win32 API. > Also one trick more... in some apps I think I used to set a bool > when receiveing a window resize/minimize/maximize command and then > just eat all window size related messages without processing them Thanks :-) Oscar. ----- Original Message ----- From: "Alen Ladavac" <ale...@cr...> To: "Game Development for MS Windows" <gam...@li...> Sent: Thursday, September 06, 2007 3:48 PM Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps running > Are you resetting display mode when you receive WM_SYSCOMMAND,SC_MINIMIZE? > > Also one trick more... in some apps I think I used to set a bool > when receiveing a window resize/minimize/maximize command and then > just eat all window size related messages without processing them > until we empty the queue (no more messages pending). This kills all > quirks that Windows throw on you as sideeffects of changing a window > size. > > Alen > > Oscar wrote: > >> Replying to my own post... > >> I eventually got it working by recording the HWND passed with the >> WM_CANCELMODE message, then next time around my game loop calling >> ShowWindow( hWnd, SW_MINIMIZE ). This may not be the ideal solution to >> the >> problem so I'd still be interested in hearing if there's a better way. > >> Thanks to all who helped, > >> Oscar. > > >> ----- Original Message ----- >> From: "Oscar Cooper" <oc...@fr...> >> To: "Game Development for MS Windows" >> <gam...@li...> >> Sent: Thursday, September 06, 2007 12:54 PM >> Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps >> running > > >>>I still haven't got this working, testing under WinXP >>> >>> Alen's idea gets me most of the way there, but my window gets restored >>> immediately after being minimised. Looking through the windows message >>> trace, it looks like the minimise completes successfully: the >>> WM_SYSCOMMAND >>> triggers a bunch of further messages including the WM_ACTIVATE >>> (WA_INACTIVE) >>> and WM_ACTIVATEAPP (wParam=FALSE). However I then immediately get a >>> WM_ACTIVATE (WA_ACTIVE) message, which I assume is generated by Windows >>> in >>> response to certain properties of my window or because I'm not handling >>> some >>> messages correctly. >>> >>> In addition to Alen's code I've also tried experimenting with the window >>> style flags, and even tried calling SetWindowPos to force my window >>> first >>> to >>> the bottom of the z-order and then again to put it back on top, to make >>> sure >>> it's not TOPMOST, but I'm still missing something. >>> >>> I hate working with API's I don't know very well, I feel like such a >>> n00b >>> ;-> >>> >>> Can anyone bail me out? >>> >>> Cheers, >>> >>> Oscar. >>> >>> >>> >>> ----- Original Message ----- >>> From: "Alen Ladavac" <ale...@cr...> >>> To: <gam...@li...> >>> Sent: Tuesday, September 04, 2007 5:03 PM >>> Subject: Re: [GD-Windows] Alt+Tab in fullscreen with no other apps >>> running >>> >>> >>>> Hi Oscar, >>>> >>>> IIRC, we've always been doing something like >>>> >>>> if( (msg.message==WM_ACTIVATE && (LOWORD(msg.wParam)==WA_INACTIVE >>>> || >>>> HIWORD(msg.wParam))) >>>> || msg.message==WM_CANCELMODE >>>> || msg.message==WM_KILLFOCUS >>>> || (msg.message==WM_ACTIVATEAPP && !msg.wParam)) { >>>> >>>> if (bInFullScreen) { >>>> PostMessage(NULL, WM_SYSCOMMAND, SC_MINIMIZE, 0); >>>> } >>>> >>>> That seems to work for us, YMMV. >>>> >>>> HTH, >>>> Alen >>>> >>>> Oscar wrote: >>>> >>>>> Hi, >>>> >>>>> Does anyone know if there's something I have to do (or avoid doing) to >>>>> make >>>>> my game minimise when the player hits Alt+Tab whilst running in >>>>> fullscreen >>>>> with no other apps running? >>>> >>>>> My game isn't minimising in pre-Vista versions of Windows, but other >>>>> games >>>>> seem to do so. Windows isn't sending me any WM_ACTIVATE or >>>>> WM_ACTIVATEAPP >>>>> messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm >>>>> passing >>>>> these on to the default WndProc expecting it to handle any necessary >>>>> plumbing. >>>> >>>>> With other apps running the Alt+Tab behaviour is correct in >>>>> fullscreen, >>>>> but >>>>> in this case Windows is sending me a completely different sequence of >>>>> messages. >>>> >>>>> Thanks in advance, >>>> >>>>> Oscar Cooper >>>>> Lead Programmer >>>>> Frontier Developments Ltd >>>> >>>> >>>> >>>>> ------------------------------------------------------------------------- >>>>> This SF.net email is sponsored by: Splunk Inc. >>>>> Still grepping through log files to find problems? Stop. >>>>> Now Search log events and configuration files using AJAX and a >>>>> browser. >>>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>>> _______________________________________________ >>>>> Gamedevlists-windows mailing list >>>>> Gam...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>>>> Archives: >>>>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >>>> >>>> >>>> >>>> ------------------------------------------------------------------------- >>>> This SF.net email is sponsored by: Splunk Inc. >>>> Still grepping through log files to find problems? Stop. >>>> Now Search log events and configuration files using AJAX and a browser. >>>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>>> _______________________________________________ >>>> Gamedevlists-windows mailing list >>>> Gam...@li... >>>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>>> Archives: >>>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >>>> >>> >>> >>> >>> ------------------------------------------------------------------------- >>> This SF.net email is sponsored by: Splunk Inc. >>> Still grepping through log files to find problems? Stop. >>> Now Search log events and configuration files using AJAX and a browser. >>> Download your FREE copy of Splunk now >> http://get.splunk.com/ >>> _______________________________________________ >>> Gamedevlists-windows mailing list >>> Gam...@li... >>> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >>> Archives: >>> http://sourceforge.net/mailarchive/forum.php?forum_id=555 >>> > > > >> ------------------------------------------------------------------------- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? Stop. >> Now Search log events and configuration files using AJAX and a browser. >> Download your FREE copy of Splunk now >> http://get.splunk.com/ >> _______________________________________________ >> Gamedevlists-windows mailing list >> Gam...@li... >> https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows >> Archives: >> http://sourceforge.net/mailarchive/forum.php?forum_id=555 > > > > -- > Alen > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |
From: George G. <ge...@ba...> - 2007-09-04 19:00:18
|
There are also a number of other elements that could affect your game's alt-tab response: - Window Style and Window StyleEx flags (during create/adjust window) - SetWindowPos parameters - Use of SetForegroundWindow() and LockSetForegroundWindow() calls Also, alt-tab settings can differ not only in different OSes (2000 vs XP vs Vista) but also different service packs (especially of XP). And there's also some registry OS tweaks that change response and how 'sticky' the topmost window is. Microsoft seems to perpetually adjust this as new apps find new ways to 'steal' focus and need to be dealt with. (Interestingly, some of the most notorious 'stealing' apps are made by Microsoft themselves, such as their outlook and MSN 'notifications' etc). The moral of the story is to test on as many different systems as possible, including multi-mon combinations as well. -- George. - Lead Programmer, BattleGoat Studios - www.battlegoat.com -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of Oscar Cooper Sent: Tuesday, September 04, 2007 11:05 AM To: gam...@li... Subject: [GD-Windows] Alt+Tab in fullscreen with no other apps running Hi, Does anyone know if there's something I have to do (or avoid doing) to make my game minimise when the player hits Alt+Tab whilst running in fullscreen with no other apps running? My game isn't minimising in pre-Vista versions of Windows, but other games seem to do so. Windows isn't sending me any WM_ACTIVATE or WM_ACTIVATEAPP messages. I am getting WM_NCACTIVATE and WM_CANCELMODE, and I'm passing these on to the default WndProc expecting it to handle any necessary plumbing. With other apps running the Alt+Tab behaviour is correct in fullscreen, but in this case Windows is sending me a completely different sequence of messages. Thanks in advance, Oscar Cooper Lead Programmer Frontier Developments Ltd |