From 9002bf3d2985e0c85c92bedd314acb8ac043f36a Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 4 Mar 2004 05:08:04 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=3027 --- checkin_notes | 24 + client/app.h | 2 +- client/net_xfer.C | 13 +- client/win/boinc_cli.h | 16 + client/win/boinc_cli.rc | 102 ++ client/win/boinc_dll.h | 16 + client/win/boinc_dll.rc | 102 ++ client/win/{resource.h => boinc_gui.h} | 4 +- client/win/{resource.rc => boinc_gui.rc} | 6 +- client/win/boinc_ss.h | 1 - client/win/update-resource-version | 77 +- client/win/win_idle_tracker.def | 1 - client/win/win_net.cpp | 4 +- client/win/wingui.h | 2 +- client/win/wingui_mainwindow.cpp | 187 +-- client/win/wingui_mainwindow.h | 39 +- win_build/boinc.vcproj | 1469 ---------------------- win_build/boinc_cli.dsp | 384 ------ win_build/boinc_cli.vcproj | 10 +- win_build/boinc_dll.vcproj | 9 +- win_build/boinc_gui.vcproj | 44 +- win_build/boinc_ss.vcproj | 10 +- win_build/upper_case.vcproj | 2 +- 23 files changed, 517 insertions(+), 2007 deletions(-) create mode 100644 client/win/boinc_cli.h create mode 100644 client/win/boinc_cli.rc create mode 100644 client/win/boinc_dll.h create mode 100644 client/win/boinc_dll.rc rename client/win/{resource.h => boinc_gui.h} (98%) mode change 100755 => 100644 rename client/win/{resource.rc => boinc_gui.rc} (98%) mode change 100755 => 100644 delete mode 100644 win_build/boinc.vcproj delete mode 100755 win_build/boinc_cli.dsp diff --git a/checkin_notes b/checkin_notes index df2401a140..f2c1421d9f 100755 --- a/checkin_notes +++ b/checkin_notes @@ -10274,3 +10274,27 @@ David Mar 3 2004 get-passwd.php login_action.php mail_passwd.php + +Rom Mar 3 2004 + - Some house keeping with the Windows sources + - All Windows binaries now have a version resource assigned to them. + - The Windows CLI should no longer need to have references to afxwin.h + - project file cleanup work to get rid of some warnings + + client/ + app.h + net_xfer.c + client/win/ + boinc_ss.rc, .h + boinc_cli.rc, .h (added) + boinc_dll.rc, .h (added) + boinc_gui.rc, .h (added) + resource.rc, .h (removed) + update-resource-version + win_idle_tracker.def + win_net.cpp + wingui.h + wingui_mainwindow.cpp, .h + winbuild/ + *.vcproj + boinc.vcproj (removed) diff --git a/client/app.h b/client/app.h index 28a3037aca..3407346205 100644 --- a/client/app.h +++ b/client/app.h @@ -21,7 +21,7 @@ #define _TASK_ #ifdef _WIN32 -#include +#include #endif #include diff --git a/client/net_xfer.C b/client/net_xfer.C index 67751339c1..37a12c0825 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -23,10 +23,17 @@ #include #ifdef _WIN32 -#include + +#ifdef _CONSOLE +#include +#else +#include "wingui_mainwindow.h" +#endif + #include #include "Win_net.h" -#include "wingui_mainwindow.h" +#include "win_util.h" + #endif #if HAVE_SYS_TIME_H @@ -207,7 +214,7 @@ int NET_XFER::open_server() { return ERR_CONNECT; } #ifndef _CONSOLE - if (WSAAsyncSelect( fd, g_myWnd->GetSafeHwnd(), g_myWnd->m_nNetActivityMsg, FD_READ|FD_WRITE )) { + if (WSAAsyncSelect( fd, g_myWnd->GetSafeHwnd(), RegisterWindowMessage(NET_ACTIVITY_MSG), FD_READ|FD_WRITE )) { errno = WSAGetLastError(); if (errno != WSAEINPROGRESS && errno != WSAEWOULDBLOCK) { closesocket(fd); diff --git a/client/win/boinc_cli.h b/client/win/boinc_cli.h new file mode 100644 index 0000000000..feddfe408d --- /dev/null +++ b/client/win/boinc_cli.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by boinc_cli.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 109 +#define _APS_NEXT_COMMAND_VALUE 40000 +#define _APS_NEXT_CONTROL_VALUE 1007 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/client/win/boinc_cli.rc b/client/win/boinc_cli.rc new file mode 100644 index 0000000000..7e774d02da --- /dev/null +++ b/client/win/boinc_cli.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "boinc_cli.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "boinc_cli.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,26,0,0 + PRODUCTVERSION 2,26,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Space Sciences Laboratory" + VALUE "FileDescription", "BOINC Core Client Command Line Interface" + VALUE "FileVersion", "2, 26, 0, 0" + VALUE "InternalName", "boinc_cli" + VALUE "LegalCopyright", "Copyright © 2003-2004 University of California" + VALUE "OriginalFilename", "boinc_cli.exe" + VALUE "ProductName", "BOINC Core Client" + VALUE "ProductVersion", "2, 26, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/client/win/boinc_dll.h b/client/win/boinc_dll.h new file mode 100644 index 0000000000..169d98c1a9 --- /dev/null +++ b/client/win/boinc_dll.h @@ -0,0 +1,16 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by boinc_dll.rc +// + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 109 +#define _APS_NEXT_COMMAND_VALUE 40000 +#define _APS_NEXT_CONTROL_VALUE 1007 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/client/win/boinc_dll.rc b/client/win/boinc_dll.rc new file mode 100644 index 0000000000..cc523d3384 --- /dev/null +++ b/client/win/boinc_dll.rc @@ -0,0 +1,102 @@ +// Microsoft Visual C++ generated resource script. +// +#include "boinc_dll.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "boinc_dll.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 2,26,0,0 + PRODUCTVERSION 2,26,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Space Sciences Laboratory" + VALUE "FileDescription", "BOINC Input Monitor" + VALUE "FileVersion", "2, 26, 0, 0" + VALUE "InternalName", "boinc_dll" + VALUE "LegalCopyright", "Copyright © 2003-2004 University of California" + VALUE "OriginalFilename", "boinc.dll" + VALUE "ProductName", "BOINC Core Client" + VALUE "ProductVersion", "2, 26, 0, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/client/win/resource.h b/client/win/boinc_gui.h old mode 100755 new mode 100644 similarity index 98% rename from client/win/resource.h rename to client/win/boinc_gui.h index 8b108eede1..12ce3b526f --- a/client/win/resource.h +++ b/client/win/boinc_gui.h @@ -1,6 +1,6 @@ //{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by resource.rc +// Microsoft Visual C++ generated include file. +// Used by boinc_gui.rc // #define IDB_LOGO 101 #define IDD_LOGIN 102 diff --git a/client/win/resource.rc b/client/win/boinc_gui.rc old mode 100755 new mode 100644 similarity index 98% rename from client/win/resource.rc rename to client/win/boinc_gui.rc index 1a4312cf85..b8a316550f --- a/client/win/resource.rc +++ b/client/win/boinc_gui.rc @@ -1,6 +1,6 @@ // Microsoft Visual C++ generated resource script. // -#include "resource.h" +#include "boinc_gui.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -301,10 +301,10 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "CompanyName", "Space Sciences Laboratory" - VALUE "FileDescription", "BOINC Core Client" + VALUE "FileDescription", "boinc_gui" VALUE "FileVersion", "2, 26, 0, 0\0" VALUE "InternalName", "boinc_gui" - VALUE "LegalCopyright", "Copyright © 2003-2004 University of California" + VALUE "LegalCopyright", "Copyright © 2004 University of California" VALUE "OriginalFilename", "boinc_gui.exe" VALUE "ProductName", "BOINC Core Client" VALUE "ProductVersion", "2, 26, 0, 0\0" diff --git a/client/win/boinc_ss.h b/client/win/boinc_ss.h index 6e4f93bb18..818bc322b0 100644 --- a/client/win/boinc_ss.h +++ b/client/win/boinc_ss.h @@ -9,7 +9,6 @@ #define IDC_BLANK 1000 #define IDC_BLANK_TIME 1001 #define IDS_ERR_GENERIC 2100 -#define IDS_ERR_NOBOINCDETECTED 2101 #define IDS_ERR_BOINCNOTDETECTED 2101 #define IDS_ERR_BOINCNOTDETECTEDSTARTUP 2102 #define IDS_ERR_BOINCNOTFOUND 2103 diff --git a/client/win/update-resource-version b/client/win/update-resource-version index d66dbfe39a..e021d63ae4 100755 --- a/client/win/update-resource-version +++ b/client/win/update-resource-version @@ -1,25 +1,80 @@ #!/usr/bin/env python # $Id$ -# update resource.rc with version numbers. +# update boinc_cli.rc with version numbers. +# update boinc_dll.rc with version numbers. +# update boinc_gui.rc with version numbers. +# update boinc_ss.rc with version numbers. import boinc_path_config from Boinc.version import * import os, re -fn_rc_old = 'resource.rc.old' -fn_rc = 'resource.rc' +version_string = '%d,%d,0,0' % (MAJOR_VERSION, MINOR_VERSION) +version_string_spaces = '"%d, %d, 0, 0\\\\0"' % (MAJOR_VERSION, MINOR_VERSION) -os.rename(fn_rc, fn_rc_old) -rc_old = open(fn_rc_old) -rc = open(fn_rc, 'w') -version_string = '%d,0,%d,0' % (MAJOR_VERSION, MINOR_VERSION) -version_string_spaces = '"%d, 0, %d, 0\\\\0"' % (MAJOR_VERSION, MINOR_VERSION) +fn_boinc_cli_rc_old = 'boinc_cli.rc.old' +fn_boinc_cli_rc = 'boinc_cli.rc' -for line in rc_old: +os.rename(fn_boinc_cli_rc, fn_boinc_cli_rc_old) +rc_boinc_cli_old = open(fn_boinc_cli_rc_old) +rc_boinc_cli = open(fn_boinc_cli_rc, 'w') + +for line in rc_boinc_cli_old: line = re.sub('( +(FILEVERSION|PRODUDUCTVERSION) +).*', '\\1'+version_string, line) line = re.sub('( +VALUE "(FileVersion|ProductVersion)", +).*', '\\1'+version_string_spaces, line) - rc.write(line) + rc_boinc_cli.write(line) -print "Updated resource.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION) +print "Updated boinc_cli.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION) + + + + +fn_boinc_dll_rc_old = 'boinc_dll.rc.old' +fn_boinc_dll_rc = 'boinc_dll.rc' + +os.rename(fn_boinc_dll_rc, fn_boinc_dll_rc_old) +rc_boinc_dll_old = open(fn_boinc_dll_rc_old) +rc_boinc_dll = open(fn_boinc_dll_rc, 'w') + +for line in rc_boinc_dll_old: + line = re.sub('( +(FILEVERSION|PRODUDUCTVERSION) +).*', '\\1'+version_string, line) + line = re.sub('( +VALUE "(FileVersion|ProductVersion)", +).*', '\\1'+version_string_spaces, line) + rc_boinc_dll.write(line) + +print "Updated boinc_dll.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION) + + + + +fn_boinc_gui_rc_old = 'boinc_gui.rc.old' +fn_boinc_gui_rc = 'boinc_gui.rc' + +os.rename(fn_boinc_gui_rc, fn_boinc_gui_rc_old) +rc_boinc_gui_old = open(fn_boinc_gui_rc_old) +rc_boinc_gui = open(fn_boinc_gui_rc, 'w') + +for line in rc_boinc_gui_old: + line = re.sub('( +(FILEVERSION|PRODUDUCTVERSION) +).*', '\\1'+version_string, line) + line = re.sub('( +VALUE "(FileVersion|ProductVersion)", +).*', '\\1'+version_string_spaces, line) + rc_boinc_gui.write(line) + +print "Updated boinc_gui.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION) + + + + +fn_boinc_ss_rc_old = 'boinc_ss.rc.old' +fn_boinc_ss_rc = 'boinc_ss.rc' + +os.rename(fn_boinc_ss_rc, fn_boinc_ss_rc_old) +rc_boinc_ss_old = open(fn_boinc_ss_rc_old) +rc_boinc_ss = open(fn_boinc_ss_rc, 'w') + +for line in rc_boinc_ss_old: + line = re.sub('( +(FILEVERSION|PRODUDUCTVERSION) +).*', '\\1'+version_string, line) + line = re.sub('( +VALUE "(FileVersion|ProductVersion)", +).*', '\\1'+version_string_spaces, line) + rc_boinc_ss.write(line) + +print "Updated boinc_ss.rc to version %d.%02d" %(MAJOR_VERSION, MINOR_VERSION) diff --git a/client/win/win_idle_tracker.def b/client/win/win_idle_tracker.def index f24545c489..cc147b0088 100644 --- a/client/win/win_idle_tracker.def +++ b/client/win/win_idle_tracker.def @@ -1,7 +1,6 @@ ; test.def : Declares the module parameters for the DLL. LIBRARY "boinc" -DESCRIPTION 'boinc Windows Dynamic Link Library' EXPORTS ; Explicit exports can go here diff --git a/client/win/win_net.cpp b/client/win/win_net.cpp index 1d416c3478..84e3d7c9c8 100644 --- a/client/win/win_net.cpp +++ b/client/win/win_net.cpp @@ -17,7 +17,7 @@ // Contributor(s): // -#include +#include #include #include #include @@ -25,7 +25,7 @@ #include #include "win_net.h" -#include "wingui.h" +//#include "wingui.h" #include "client_state.h" #define DIAL_WAIT 60 // seconds after dial to wait (in case of cancel) diff --git a/client/win/wingui.h b/client/win/wingui.h index fdc4fef111..8b8c5ee52f 100755 --- a/client/win/wingui.h +++ b/client/win/wingui.h @@ -34,7 +34,7 @@ #include "log_flags.h" #include "client_state.h" #include "error_numbers.h" -#include "resource.h" +#include "boinc_gui.h" #include "util.h" #include "win_net.h" #include "win_util.h" diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index e92650c87c..870e5e1116 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -23,19 +23,6 @@ CMyApp g_myApp; CMainWindow* g_myWnd = NULL; -/*static struct _test -{ - _test() - { - InitAllocCheck(); - } - - ~_test() - { - DeInitAllocCheck(); - } -} _myLeakFinder;*/ - ///////////////////////////////////////////////////////////////////////// // CMyApp member functions @@ -136,9 +123,27 @@ inline CString GetStrTime(CTime timeObj = CTime::GetCurrentTime()) ///////////////////////////////////////////////////////////////////////// // CMainWindow message map and member functions +// ID of show window request message +const UINT WM_BSHOWWINDOW = RegisterWindowMessage(SHOW_WIN_MSG); +// ID of net activity message +const UINT WM_BNETACTIVITY = RegisterWindowMessage(NET_ACTIVITY_MSG); +// ID of start screensaver request message +const UINT WM_BSTARTSCREENSAVER = RegisterWindowMessage(START_SS_MSG); +// ID of end screensaver request message +const UINT WM_BENDSCREENSAVER = RegisterWindowMessage(STOP_SS_MSG); +// ID of taskbar created message +const UINT WM_BTASKBARCREATED = RegisterWindowMessage(TEXT("TaskbarCreated")); + + BEGIN_MESSAGE_MAP(CMainWindow, CWnd) ON_WM_CLOSE() ON_WM_DESTROY() + ON_WM_CREATE() + ON_WM_RBUTTONDOWN() + ON_WM_SIZE() + ON_WM_SETFOCUS() + ON_WM_TIMER() + //ON_COMMAND(ID_FILE_CLEARINACTIVE, OnCommandFileClearInactive) //ON_COMMAND(ID_FILE_CLEARMESSAGES, OnCommandFileClearMessages) ON_COMMAND(ID_FILE_RUN_REQUEST_ALWAYS, OnCommandRunRequestAlways) @@ -160,12 +165,15 @@ BEGIN_MESSAGE_MAP(CMainWindow, CWnd) ON_COMMAND(ID_WORK_SHOWGRAPHICS, OnCommandWorkShowGraphics) ON_COMMAND(ID_TRANSFERS_RETRYNOW, OnCommandTransfersRetryNow) ON_COMMAND(ID_MESSAGE_COPY_TO_CLIP, OnCommandMessageCopyToClip) // Added by JBK. - ON_WM_CREATE() - ON_WM_RBUTTONDOWN() - ON_WM_SIZE() - ON_WM_SETFOCUS() - ON_WM_TIMER() + ON_MESSAGE(STATUS_ICON_ID, OnStatusIcon) + + ON_REGISTERED_MESSAGE(WM_BSHOWWINDOW, OnShowWindow) + ON_REGISTERED_MESSAGE(WM_BNETACTIVITY, OnNetworkActivity) + ON_REGISTERED_MESSAGE(WM_BSTARTSCREENSAVER, OnStartScreensaver) + ON_REGISTERED_MESSAGE(WM_BENDSCREENSAVER, OnEndScreensaver) + ON_REGISTERED_MESSAGE(WM_BTASKBARCREATED, OnTaskbarCreated) + END_MESSAGE_MAP() ////////// @@ -208,17 +216,6 @@ CMainWindow::CMainWindow() CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL); - m_nShowMsg = RegisterWindowMessage(SHOW_WIN_MSG); - m_nNetActivityMsg = RegisterWindowMessage(NET_ACTIVITY_MSG); - m_uScreenSaverMsg = RegisterWindowMessage(START_SS_MSG); - m_uEndSSMsg = RegisterWindowMessage(STOP_SS_MSG); - - // This message is sent by the shell everytime it is created - // NOTE: This normally happens if/when the shell crashes and is - // restarted. - m_uTaskbarCreatedMsg = RegisterWindowMessage(TEXT("TaskbarCreated")); - - TRACE(TEXT("CMainWIndow\n")); } ////////// @@ -1189,52 +1186,6 @@ void CMainWindow::PostNcDestroy() delete this; } -////////// -// CMainWindow::DefWindowProc -// arguments: message: message received -// wParam: message's wparam -// lParam: message's lparam -// returns: dependent on message -// function: handles any messages not handled by the window previously -LRESULT CMainWindow::DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam) -{ - if(m_nShowMsg == message) { - ShowWindow(SW_SHOW); - SetForegroundWindow(); - return 0; - } else if(m_nNetActivityMsg == message) { - gstate.net_sleep(0); - return 0; - } else if(m_uEndSSMsg == message) { - gstate.ss_logic.stop_ss(); - return 0; - } else if(m_uScreenSaverMsg == message) { - // Get the current screen blanking information - unsigned long reg_time_until_blank = 0, reg_blank_screen = 0; - unsigned long blank_time = 0; - - UtilGetRegKey(REG_BLANK_NAME, reg_blank_screen); - UtilGetRegKey(REG_BLANK_TIME, reg_time_until_blank); - if (reg_blank_screen && reg_time_until_blank>0) { - blank_time = time(0) + reg_time_until_blank*60; - } else { - blank_time = 0; - } - gstate.ss_logic.start_ss(blank_time); - return 0; - } else if (m_uTaskbarCreatedMsg == message) { - // Explorer has crashed, we need to re-register our icon with the shell - DWORD dwTempIconStatus; - - dwTempIconStatus = m_nIconState; - m_nIconState = ICON_OFF; - - SetStatusIcon(dwTempIconStatus); - return 0; - } - - return CWnd::DefWindowProc(message, wParam, lParam); -} ////////// // CMainWindow::OnClose @@ -2194,6 +2145,84 @@ void CMainWindow::OnTimer(UINT uEventID) } +////////// +// CMainWindow::OnShowWindow +// function: +// arguments: +// returns: +LRESULT CMainWindow::OnShowWindow(WPARAM wParam, LPARAM lParam) +{ + ShowWindow(SW_SHOW); + SetForegroundWindow(); + return TRUE; +} + + +////////// +// CMainWindow::OnNetworkActivity +// function: +// arguments: +// returns: +LRESULT CMainWindow::OnNetworkActivity(WPARAM wParam, LPARAM lParam) +{ + gstate.net_sleep(0); + return TRUE; +} + + +////////// +// CMainWindow::OnStartScreensaver +// function: +// arguments: +// returns: +LRESULT CMainWindow::OnStartScreensaver(WPARAM wParam, LPARAM lParam) +{ + // Get the current screen blanking information + unsigned long reg_time_until_blank = 0, reg_blank_screen = 0; + unsigned long blank_time = 0; + + UtilGetRegKey(REG_BLANK_NAME, reg_blank_screen); + UtilGetRegKey(REG_BLANK_TIME, reg_time_until_blank); + if (reg_blank_screen && reg_time_until_blank>0) { + blank_time = time(0) + reg_time_until_blank*60; + } else { + blank_time = 0; + } + gstate.ss_logic.start_ss(blank_time); + return TRUE; +} + + +////////// +// CMainWindow::OnEndScreensaver +// function: +// arguments: +// returns: +LRESULT CMainWindow::OnEndScreensaver(WPARAM wParam, LPARAM lParam) +{ + gstate.ss_logic.stop_ss(); + return TRUE; +} + + +////////// +// CMainWindow::OnTaskbarCreated +// function: +// arguments: +// returns: +LRESULT CMainWindow::OnTaskbarCreated(WPARAM wParam, LPARAM lParam) +{ + // Explorer has crashed, we need to re-register our icon with the shell + DWORD dwTempIconStatus; + + dwTempIconStatus = m_nIconState; + m_nIconState = ICON_OFF; + + SetStatusIcon(dwTempIconStatus); + return TRUE; +} + + ////////// // CMainWindow::should_request_global_prefs // arguments: void @@ -2203,13 +2232,11 @@ void CMainWindow::OnTimer(UINT uEventID) // file. inline bool CMainWindow::should_request_global_prefs() { - // TODO: find a better way to test file existence on windows bool missing = false; - FILE* f = fopen(GLOBAL_PREFS_FILE_NAME, "r"); - if (!f) + + if (boinc_file_exists(GLOBAL_PREFS_FILE_NAME)) missing = true; - else - fclose(f); + return missing; } diff --git a/client/win/wingui_mainwindow.h b/client/win/wingui_mainwindow.h index 1f9073ae71..31240318f1 100755 --- a/client/win/wingui_mainwindow.h +++ b/client/win/wingui_mainwindow.h @@ -72,6 +72,7 @@ #define XFER_COLS 7 #define MESSAGE_COLS 3 + ////////// // class: CMyApp // parent: CWinApp @@ -97,7 +98,6 @@ public: BOOL IsUserSuspended(); BOOL RequestNetConnect(); void DetachProject(PROJECT *); - UINT m_nNetActivityMsg; // ID of net activity message CSSWindow* m_pSSWnd; // default graphics window protected: @@ -123,10 +123,6 @@ protected: BOOL m_bRequest; // does the user have a net connection request? int m_nContextItem; // item selected for context menu UINT m_nGuiTimerID; // ID of current GUI timer - UINT m_nShowMsg; // ID of show window request message - UINT m_uScreenSaverMsg; // ID of screensaver message - UINT m_uEndSSMsg; // ID of end screensaver request message - UINT m_uTaskbarCreatedMsg; // ID of taskbar created message void UpdateRunRequestMenu(CMenu* pMenu); @@ -146,11 +142,17 @@ protected: void Syncronize(CProgressListCtrl*, vector*); virtual void PostNcDestroy(); bool should_request_global_prefs(); - LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); afx_msg void OnClose(); afx_msg void OnDestroy(); - afx_msg void OnCommandSettingsQuit(); + afx_msg int OnCreate(LPCREATESTRUCT); + afx_msg BOOL OnNotify(WPARAM, LPARAM, LRESULT*); + afx_msg void OnRButtonDown(UINT, CPoint); + afx_msg void OnSetFocus(CWnd*); + afx_msg void OnSize(UINT, int, int); + afx_msg void OnTimer(UINT); + + afx_msg void OnCommandSettingsQuit(); afx_msg void OnCommandSettingsLogin(); afx_msg void OnCommandSettingsProxyServer(); afx_msg void OnCommandHelpAbout(); @@ -162,24 +164,25 @@ protected: afx_msg void OnCommandTransfersRetryNow(); afx_msg void OnCommandFileClearInactive(); afx_msg void OnCommandFileClearMessages(); - afx_msg void OnCommandRunBenchmarks(); + afx_msg void OnCommandRunBenchmarks(); afx_msg void OnCommandConnectionHangupIfDialed(); afx_msg void OnCommandConnectionConfirmBeforeConnecting(); afx_msg void OnCommandShow(); afx_msg void OnCommandHide(); - afx_msg void OnCommandRunRequestAlways(); - afx_msg void OnCommandRunRequestAuto(); - afx_msg void OnCommandRunRequestNever(); + afx_msg void OnCommandRunRequestAlways(); + afx_msg void OnCommandRunRequestAuto(); + afx_msg void OnCommandRunRequestNever(); afx_msg void OnCommandExit(); afx_msg void OnCommandMessageCopyToClip(); - afx_msg int OnCreate(LPCREATESTRUCT); - afx_msg BOOL OnNotify(WPARAM, LPARAM, LRESULT*); - afx_msg void OnRButtonDown(UINT, CPoint); - afx_msg void OnSetFocus(CWnd*); - afx_msg void OnSize(UINT, int, int); - afx_msg LRESULT OnStatusIcon(WPARAM, LPARAM); - afx_msg void OnTimer(UINT); + + afx_msg LRESULT OnStatusIcon( WPARAM, LPARAM ); + + afx_msg LRESULT OnShowWindow( WPARAM, LPARAM ); + afx_msg LRESULT OnNetworkActivity( WPARAM, LPARAM ); + afx_msg LRESULT OnStartScreensaver( WPARAM, LPARAM ); + afx_msg LRESULT OnEndScreensaver( WPARAM, LPARAM ); + afx_msg LRESULT OnTaskbarCreated( WPARAM, LPARAM ); CString m_MenuLabelRetryNow, m_MenuLabelGetPreferences; CString m_DialogResetQuery, m_DialogDetachQuery; diff --git a/win_build/boinc.vcproj b/win_build/boinc.vcproj deleted file mode 100644 index fb5d7eb09b..0000000000 --- a/win_build/boinc.vcproj +++ /dev/null @@ -1,1469 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/win_build/boinc_cli.dsp b/win_build/boinc_cli.dsp deleted file mode 100755 index 6cfcafb95b..0000000000 --- a/win_build/boinc_cli.dsp +++ /dev/null @@ -1,384 +0,0 @@ -# Microsoft Developer Studio Project File - Name="boinc_cli" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Application" 0x0101 - -CFG=boinc_cli - Win32 Debug -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "boinc_cli.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "boinc_cli.mak" CFG="boinc_cli - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "boinc_cli - Win32 Release" (based on "Win32 (x86) Application") -!MESSAGE "boinc_cli - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "boinc_cli - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release" -# PROP BASE Intermediate_Dir "Release" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Build\Release" -# PROP Intermediate_Dir "Build\Release\obj" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c -# ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "../lib/" /I "../api/" /I "../RSAEuro/source/" /I "../client/win/" /I "../client" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D MAJOR_VERSION=1 /D MINOR_VERSION=04 /D "WIN_CLI" /YX /FD /c /Tp -# SUBTRACT CPP /Fr -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 wsock32.lib wininet.lib winmm.lib nafxcwd.lib libcmtd.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"nafxcwd" /nodefaultlib:"libcmtd" /nodefaultlib:"libcmt" /nodefaultlib:"libcd" - -!ELSEIF "$(CFG)" == "boinc_cli - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug" -# PROP BASE Intermediate_Dir "Debug" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Build\Debug\" -# PROP Intermediate_Dir "Build\Debug\obj" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c -# ADD CPP /nologo /MT /W3 /Gm /Gi /GX /ZI /Od /I "../lib/" /I "../api/" /I "../RSAEuro/source/" /I "../client/win/" /I "../client" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN_CLI" /FR /YX /FD /GZ /c /Tp -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 wsock32.lib wininet.lib winmm.lib nafxcwd.lib libcmtd.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"nafxcwd" /nodefaultlib:"libcmtd" /nodefaultlib:"libcmt" /nodefaultlib:"libcd" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "boinc_cli - Win32 Release" -# Name "boinc_cli - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=..\Client\app.C -# End Source File -# Begin Source File - -SOURCE=..\lib\app_ipc.C -# End Source File -# Begin Source File - -SOURCE=..\client\client_messages.C -# End Source File -# Begin Source File - -SOURCE=..\Client\client_state.C -# End Source File -# Begin Source File - -SOURCE=..\Client\client_types.C -# End Source File -# Begin Source File - -SOURCE=..\client\cpu_benchmark.C -# End Source File -# Begin Source File - -SOURCE=..\Lib\Crypt.c -# End Source File -# Begin Source File - -SOURCE=..\client\cs_account.C -# End Source File -# Begin Source File - -SOURCE=..\Client\cs_apps.C -# End Source File -# Begin Source File - -SOURCE=..\client\cs_benchmark.C -# End Source File -# Begin Source File - -SOURCE=..\client\cs_cmdline.C -# End Source File -# Begin Source File - -SOURCE=..\Client\cs_files.C -# End Source File -# Begin Source File - -SOURCE=..\client\cs_prefs.C -# End Source File -# Begin Source File - -SOURCE=..\Client\cs_scheduler.C -# End Source File -# Begin Source File - -SOURCE=..\client\cs_statefile.C -# End Source File -# Begin Source File - -SOURCE=..\Client\file_names.C -# End Source File -# Begin Source File - -SOURCE=..\Client\file_xfer.C -# End Source File -# Begin Source File - -SOURCE=..\lib\filesys.C -# End Source File -# Begin Source File - -SOURCE=..\Client\Hostinfo.c -# End Source File -# Begin Source File - -SOURCE=..\Client\win\hostinfo_win.cpp -# End Source File -# Begin Source File - -SOURCE=..\Client\http.C -# End Source File -# Begin Source File - -SOURCE=..\lib\language.C -# End Source File -# Begin Source File - -SOURCE=..\Client\log_flags.C -# End Source File -# Begin Source File - -SOURCE=..\client\main.C -# End Source File -# Begin Source File - -SOURCE=..\Lib\Md5.c -# End Source File -# Begin Source File - -SOURCE=..\Lib\Md5_file.c -# End Source File -# Begin Source File - -SOURCE=..\client\message.C -# End Source File -# Begin Source File - -SOURCE=..\lib\messages.C -# End Source File -# Begin Source File - -SOURCE=..\Client\net_stats.C -# End Source File -# Begin Source File - -SOURCE=..\Client\net_xfer.C -# End Source File -# Begin Source File - -SOURCE=..\Lib\parse.C -# End Source File -# Begin Source File - -SOURCE=..\Client\pers_file_xfer.C -# End Source File -# Begin Source File - -SOURCE=..\Client\Prefs.c -# End Source File -# Begin Source File - -SOURCE=..\Client\scheduler_op.C -# End Source File -# Begin Source File - -SOURCE=..\lib\shmem.C -# End Source File -# Begin Source File - -SOURCE=..\client\ss_logic.C -# End Source File -# Begin Source File - -SOURCE=..\Client\time_stats.C -# End Source File -# Begin Source File - -SOURCE=..\lib\util.C -# End Source File -# Begin Source File - -SOURCE=..\Client\Version.c -# End Source File -# Begin Source File - -SOURCE=..\Client\win\Win_main.cpp -# End Source File -# Begin Source File - -SOURCE=..\Client\win\Win_net.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=..\client\app.h -# End Source File -# Begin Source File - -SOURCE=..\lib\app_ipc.h -# End Source File -# Begin Source File - -SOURCE=..\client\client_state.h -# End Source File -# Begin Source File - -SOURCE=..\client\client_types.h -# End Source File -# Begin Source File - -SOURCE=..\lib\error_numbers.h -# End Source File -# Begin Source File - -SOURCE=..\client\file_names.h -# End Source File -# Begin Source File - -SOURCE=..\client\file_xfer.h -# End Source File -# Begin Source File - -SOURCE=..\client\filesys.h -# End Source File -# Begin Source File - -SOURCE=..\client\hostinfo.h -# End Source File -# Begin Source File - -SOURCE=..\client\http.h -# End Source File -# Begin Source File - -SOURCE=..\lib\language.h -# End Source File -# Begin Source File - -SOURCE=..\client\log_flags.h -# End Source File -# Begin Source File - -SOURCE=..\client\maybe_gui.h -# End Source File -# Begin Source File - -SOURCE=..\lib\md5.h -# End Source File -# Begin Source File - -SOURCE=..\lib\md5_file.h -# End Source File -# Begin Source File - -SOURCE=..\client\message.h -# End Source File -# Begin Source File - -SOURCE=..\client\net_stats.h -# End Source File -# Begin Source File - -SOURCE=..\client\net_xfer.h -# End Source File -# Begin Source File - -SOURCE=..\lib\parse.h -# End Source File -# Begin Source File - -SOURCE=..\Client\pers_file_xfer.h -# End Source File -# Begin Source File - -SOURCE=..\client\prefs.h -# End Source File -# Begin Source File - -SOURCE=..\client\scheduler_op.h -# End Source File -# Begin Source File - -SOURCE=..\client\speed_stats.h -# End Source File -# Begin Source File - -SOURCE=..\client\ss_logic.h -# End Source File -# Begin Source File - -SOURCE=..\client\time_stats.h -# End Source File -# Begin Source File - -SOURCE=..\client\util.h -# End Source File -# Begin Source File - -SOURCE=..\client\version.h -# End Source File -# Begin Source File - -SOURCE=..\Client\win\Win_net.h -# End Source File -# Begin Source File - -SOURCE=..\Client\win\windows_cpp.h -# End Source File -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# End Group -# End Target -# End Project diff --git a/win_build/boinc_cli.vcproj b/win_build/boinc_cli.vcproj index dcd64a09bb..49ed70bf05 100644 --- a/win_build/boinc_cli.vcproj +++ b/win_build/boinc_cli.vcproj @@ -33,7 +33,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" - DebugInformationFormat="4" + DebugInformationFormat="3" CompileAs="2"/> @@ -41,7 +41,7 @@ Name="VCLinkerTool" AdditionalDependencies="wsock32.lib wininet.lib winmm.lib nafxcwd.lib libcmtd.lib" OutputFile=".\Build\Debug/boinc_cli.exe" - LinkIncremental="2" + LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="libc,nafxcwd,libcmtd,libcmt,libcd" GenerateDebugInformation="TRUE" @@ -1094,6 +1094,9 @@ + + @@ -1188,6 +1191,9 @@ + + diff --git a/win_build/boinc_dll.vcproj b/win_build/boinc_dll.vcproj index 10958a2d86..36e4a908ae 100644 --- a/win_build/boinc_dll.vcproj +++ b/win_build/boinc_dll.vcproj @@ -32,7 +32,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" - DebugInformationFormat="4"/> + DebugInformationFormat="3"/> + + @@ -178,6 +182,9 @@ + + diff --git a/win_build/boinc_gui.vcproj b/win_build/boinc_gui.vcproj index 87bcccd7ed..3f2b4ab82d 100644 --- a/win_build/boinc_gui.vcproj +++ b/win_build/boinc_gui.vcproj @@ -103,7 +103,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" - DebugInformationFormat="4" + DebugInformationFormat="3" CompileAs="2"/> @@ -922,23 +922,6 @@ CompileAs="2"/> - - - - - - - - + + @@ -1360,9 +1346,6 @@ - - @@ -1415,11 +1398,28 @@ + + + RelativePath="..\client\win\boinc_gui.rc"> + + + + + + diff --git a/win_build/boinc_ss.vcproj b/win_build/boinc_ss.vcproj index 7d7dda34ea..fe7a1d7323 100644 --- a/win_build/boinc_ss.vcproj +++ b/win_build/boinc_ss.vcproj @@ -33,7 +33,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="TRUE" - DebugInformationFormat="4" + DebugInformationFormat="3" CompileAs="0"/> @@ -41,7 +41,7 @@ Name="VCLinkerTool" AdditionalDependencies="winmm.lib" OutputFile="Build\Debug\boinc.scr" - LinkIncremental="2" + LinkIncremental="1" SuppressStartupBanner="TRUE" IgnoreDefaultLibraryNames="" GenerateDebugInformation="TRUE" @@ -181,6 +181,9 @@ + + @@ -194,9 +197,6 @@ - -