Alt-Tabbing Crashes Game

Issues Solved, posting for others.

Would host a lobby or game. After a few minutes, the screen would flash white. Game would then crash if I tried to alt-tab out. Seemed to be caused by an issue with DirectX and the game losing access to the graphics card. The error in the log is:

warning: c:\work\rts\main\code\src\libs\gpggal\DeviceD3D9.cpp(866) An invalid parameter was passed to the returning function

I searched the web and tried various fixes, non of which worked:
-Reinstall Supreme Commander
-Reinstall FAF
-Reinstall Graphics Drivers
-Reinstall DirectX
-Update BIOS
-Reinstall Java
-Set game to Windows 7 Compatibility Mode
-Under Compatibility, Disable fullscreen optimizations
(Note, some of these seemed to have worked for other people)

I use a Lenovo Laptop with a QHD screen. The game at this resolution makes the UI very small and difficult to read, so I set my in-game resolution to lower. This wasn't a problem until the last few days, so don't know if it is somehow related to the new FAF Client, where if I Alt-Tabbed any time after the screen had flashed white, the game would crash with the above error. If trying to host a game immediately after a crash, the game would crash without even loading the lobby from the same error. Restarting the computer was the only way to host again.

Setting the game to the native resolution of the screen, the screen never flashes white and will not crash when alt-tabbing.

@rama Please pass this along to whomever you got this from:

All versions of SCFA hates Alt+Tab or other things that take focus away while playing in fullscreen, so if you're going to do that, then it's highly recommended that you play in Windowed. There are programs like Borderless Gaming or scripts like one of the ones in this FAF forum thread to make the window fit the entire screen so it appears that you're playing in fullscreen even though you're not.

Thank you for the information. That is very helpful!