MAV on Ctrl+Alt+Del

Blitz3D Forums/Blitz3D Bug Reports/MAV on Ctrl+Alt+Del

Ok, I seem to have gotten a B3D app able to handle Win+L, Ctrl+Alt+Enter, etc. I had to do two things:

First, each time through the main loop test if the primary direct draw surface has been lost: This requires passing SystemProperty( "DirectDraw7" ) to my helper DLL after the video mode has been set, enumerating all DD Surfaces until the primary one is found, then checking (using IsLost() via an exported DLL function) each time though the main loop if it has been lost. If the primary surface has been lost, close and re-open B3D graphics mode.

Second, I added a check for whenever a full screen app has lost focus, for what ever reason, to close/re-open B3D graphic mode.

For the curious, the pertinent part of my main loop looks like this (NOTE: this is placed at the very top of the main loop):

If app_DDWasLost() Then
 app_lout( "(--- DirectDraw Lost ---)" );
 m_content_unloadCurrent()
 If Not m_display_uninit() Then Exit
 If Not m_display_init() Then Exit
 If Not m_content_loadCurrent() Then Exit

Else If (g\use_fullscreen = False) And app_displayChanged() Then
 app_lout( "(--- Display Changed ---)" );
 m_content_unloadCurrent()
 If Not m_display_uninit() Then Exit
 If Not m_display_init() Then Exit
 If Not m_content_loadCurrent() Then Exit
 app_clearDisplayChanged()

Else If (g\use_fullscreen = True) And app_hasLostFocus() Then
 app_lout( "(--- Full Screen App Lost Focus ---)" )
 m_content_unloadCurrent()
 If Not m_display_uninit() Then Exit
 If Not m_display_init() Then Exit
 If Not m_content_loadCurrent() Then Exit
 prev_time = MilliSecs()
 app_clearHasLostFocus()			
End If					

HTH