Re: Alt+Tab in fullscreen with no other apps running

"Oscar Cooper" <[email protected]> Thu, 6 Sep 2007 16:05:24 +0100
Newsgroups gmane.games.devel.windows
Message-ID <[email protected]>
> 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" <[email protected]>
To: "Game Development for MS Windows" 
<[email protected]>
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" <[email protected]>
>> To: "Game Development for MS Windows"
>> <[email protected]>
>> 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" <[email protected]>
>>> To: <[email protected]>
>>> 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
>>>>> [email protected]
>>>>> 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
>>>> [email protected]
>>>> 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
>>> [email protected]
>>> 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
>> [email protected]
>> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=555