@ -70,6 +70,31 @@ char *hsScalarToStr(float s)
return hsStrBuf ;
return hsStrBuf ;
}
}
class hsMinimizeClientGuard
{
# ifdef CLIENT
hsWindowHndl fWnd ;
public :
hsMinimizeClientGuard ( )
{
# ifdef HS_BUILD_FOR_WIN32
fWnd = GetActiveWindow ( ) ;
// If the application's topmost window is fullscreen, minimize it before displaying an error
if ( ( GetWindowLong ( fWnd , GWL_STYLE ) & WS_POPUP ) ! = 0 )
ShowWindow ( fWnd , SW_MINIMIZE ) ;
# endif // HS_BUILD_FOR_WIN32
}
~ hsMinimizeClientGuard ( )
{
# ifdef HS_BUILD_FOR_WIN32
ShowWindow ( fWnd , SW_RESTORE ) ;
# endif // HS_BUILD_FOR_WIN32
}
# endif // CLIENT
} ;
bool hsMessageBox_SuppressPrompts = false ;
bool hsMessageBox_SuppressPrompts = false ;
int hsMessageBoxWithOwner ( void * owner , const char message [ ] , const char caption [ ] , int kind , int icon )
int hsMessageBoxWithOwner ( void * owner , const char message [ ] , const char caption [ ] , int kind , int icon )
@ -106,9 +131,7 @@ int hsMessageBoxWithOwner(void * owner, const char message[], const char caption
else
else
flags | = MB_ICONERROR ;
flags | = MB_ICONERROR ;
# ifdef CLIENT
hsMinimizeClientGuard guard ;
ErrorMinimizeAppWindow ( ) ;
# endif
int ans = MessageBox ( ( HWND ) owner , message , caption , flags ) ;
int ans = MessageBox ( ( HWND ) owner , message , caption , flags ) ;
switch ( ans )
switch ( ans )
@ -160,9 +183,7 @@ int hsMessageBoxWithOwner(void * owner, const wchar_t message[], const wchar_t c
else
else
flags | = MB_ICONERROR ;
flags | = MB_ICONERROR ;
# ifdef CLIENT
hsMinimizeClientGuard guard ;
ErrorMinimizeAppWindow ( ) ;
# endif
int ans = MessageBoxW ( ( HWND ) owner , message , caption , flags ) ;
int ans = MessageBoxW ( ( HWND ) owner , message , caption , flags ) ;
switch ( ans )
switch ( ans )