*** empty log message ***

svn path=/trunk/boinc/; revision=4900
This commit is contained in:
Rom Walton 2004-12-19 04:27:02 +00:00
parent ba1eb5dc5e
commit ab98339572
3 changed files with 71 additions and 28 deletions

View File

@ -21,6 +21,9 @@
#define BOINC_WINDOW_CLASS_NAME "BOINC_app" #define BOINC_WINDOW_CLASS_NAME "BOINC_app"
const UINT WM_BOINCSFW = RegisterWindowMessage(TEXT("BOINCSetForegroundWindow"));
static HDC hDC = NULL; static HDC hDC = NULL;
static HGLRC hRC = NULL; static HGLRC hRC = NULL;
static HWND hWnd = NULL; // Holds Our Window Handle static HWND hWnd = NULL; // Holds Our Window Handle
@ -309,6 +312,10 @@ LRESULT CALLBACK WndProc(
} }
app_graphics_resize(LOWORD(lParam), HIWORD(lParam)); app_graphics_resize(LOWORD(lParam), HIWORD(lParam));
return 0; return 0;
default:
if ( WM_BOINCSFW == uMsg ) {
SetForegroundWindow(hWnd);
}
} }
// Pass All Unhandled Messages To DefWindowProc // Pass All Unhandled Messages To DefWindowProc

View File

@ -21588,3 +21588,12 @@ Rom 18 Dec 2004
lib/ lib/
hostinfo.h hostinfo.h
Rom 18 Dec 2004
- Add another layer of checks for Windows 2000 or better machines to get
try and get graphics to appear.
api/
windows_opengl.C
client/win/
win_screensaver.cpp

View File

@ -47,6 +47,17 @@
#include "win_util.h" #include "win_util.h"
//
// Define the stuff needed to actually do a set foreground window on
// Windows 2000 or later machines.
//
#ifndef BSF_ALLOWSFW
#define BSF_ALLOWSFW 0x00000080
#endif
const UINT WM_BOINCSFW = RegisterWindowMessage(TEXT("BOINCSetForegroundWindow"));
static CScreensaver* gs_pScreensaver = NULL; static CScreensaver* gs_pScreensaver = NULL;
@ -60,8 +71,7 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
#ifdef _DEBUG #ifdef _DEBUG
// Initialize Diagnostics when compiled for debug // Initialize Diagnostics when compiled for debug
try { retval = boinc_init_diagnostics (
boinc_init_diagnostics (
BOINC_DIAG_DUMPCALLSTACKENABLED | BOINC_DIAG_DUMPCALLSTACKENABLED |
BOINC_DIAG_HEAPCHECKENABLED | BOINC_DIAG_HEAPCHECKENABLED |
BOINC_DIAG_MEMORYLEAKCHECKENABLED | BOINC_DIAG_MEMORYLEAKCHECKENABLED |
@ -69,10 +79,10 @@ INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
BOINC_DIAG_REDIRECTSTDERROVERWRITE | BOINC_DIAG_REDIRECTSTDERROVERWRITE |
BOINC_DIAG_TRACETOSTDERR BOINC_DIAG_TRACETOSTDERR
); );
} if (retval)
catch (boinc_runtime_base_exception e)
{ {
MessageBox(NULL, e.what(), "BOINC SCreensaver Diagnostic Error", MB_OK); BOINCTRACE("WinMain - BOINC Screensaver Diagnostic Error '%d'", retval);
MessageBox(NULL, NULL, "BOINC Screensaver Diagnostic Error", MB_OK);
} }
#endif #endif
@ -573,7 +583,7 @@ HRESULT CScreensaver::CreateSaverWindow()
m_Monitors[0].hWnd = m_hWnd; m_Monitors[0].hWnd = m_hWnd;
GetClientRect( m_hWnd, &m_rcRenderTotal ); GetClientRect( m_hWnd, &m_rcRenderTotal );
GetClientRect( m_hWnd, &m_rcRenderCurDevice ); GetClientRect( m_hWnd, &m_rcRenderCurDevice );
SetTimer(m_hWnd, 2, 1000, NULL); SetTimer(m_hWnd, 2, 10000, NULL);
break; break;
case sm_full: case sm_full:
@ -606,7 +616,7 @@ HRESULT CScreensaver::CreateSaverWindow()
if( m_hWnd == NULL ) if( m_hWnd == NULL )
m_hWnd = pMonitorInfo->hWnd; m_hWnd = pMonitorInfo->hWnd;
SetTimer(pMonitorInfo->hWnd, 2, 1000, NULL); SetTimer(pMonitorInfo->hWnd, 2, 10000, NULL);
} }
} }
} }
@ -867,6 +877,20 @@ LRESULT CScreensaver::PrimarySaverProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPA
{ {
BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground.\n")); BOINCTRACE(_T("CScreensaver::PrimarySaverProc - Graphics Window Detected but NOT the foreground window, bringing window to foreground.\n"));
SetForegroundWindow(hwndBOINCGraphicsWindow); SetForegroundWindow(hwndBOINCGraphicsWindow);
hwndForegroundWindow = GetForegroundWindow();
if ( hwndForegroundWindow != hwndBOINCGraphicsWindow )
{
// This may be needed on Windows 2000 or better machines
DWORD dwComponents = BSM_APPLICATIONS;
BroadcastSystemMessage(
BSF_ALLOWSFW,
&dwComponents,
WM_BOINCSFW,
NULL,
NULL
);
}
} }
} }
break; break;
@ -1794,8 +1818,11 @@ BOOL CScreensaver::IsConfigStartupBOINC()
BOINCTRACE(_T("IsConfigStartupBOINC: Returning '%d'\n"), bRetVal); BOINCTRACE(_T("IsConfigStartupBOINC: Returning '%d'\n"), bRetVal);
return bRetVal; return bRetVal;
} }
#ifdef __GNUC__ #ifdef __GNUC__
static volatile const char __attribute__((unused)) *BOINCrcsid="$Id$"; static volatile const char __attribute__((unused)) *BOINCrcsid="$Id$";
#else #else
static volatile const char *BOINCrcsid="$Id$"; static volatile const char *BOINCrcsid="$Id$";
#endif #endif