From 012269c07956d9ced5de1625eaeff8a09954858a Mon Sep 17 00:00:00 2001 From: Dan Werthimer Date: Thu, 22 May 2003 21:31:36 +0000 Subject: [PATCH] no message svn path=/trunk/boinc/; revision=1240 --- client/win/wingui_mainwindow.cpp | 41 ++++++++++++++++++++++++++++--- client/win/wingui_mainwindow.h | 1 + todo | 4 --- win_build/boinc_cli/boinc_cli.dsp | 4 +-- win_build/boinc_gui/boinc_gui.dsp | 4 +-- 5 files changed, 42 insertions(+), 12 deletions(-) diff --git a/client/win/wingui_mainwindow.cpp b/client/win/wingui_mainwindow.cpp index c4475b5708..196eb7f8bf 100755 --- a/client/win/wingui_mainwindow.cpp +++ b/client/win/wingui_mainwindow.cpp @@ -64,6 +64,7 @@ int CMyApp::ExitInstance() BEGIN_MESSAGE_MAP(CMainWindow, CWnd) ON_WM_CLOSE() + ON_WM_DESTROY() ON_COMMAND(ID_FILE_CLEARINACTIVE, OnCommandFileClearInactive) ON_COMMAND(ID_FILE_CLEARMESSAGES, OnCommandFileClearMessages) ON_COMMAND(ID_FILE_HIDE, OnCommandHide) @@ -97,12 +98,31 @@ END_MESSAGE_MAP() // function: registers window class, creates and poisitions window. CMainWindow::CMainWindow() { + WNDCLASS wndcls; + + memset(&wndcls, 0, sizeof(WNDCLASS)); // start with NULL defaults + wndcls.style = 0; + //wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW; + wndcls.lpfnWndProc = ::DefWindowProc; + wndcls.hInstance = AfxGetInstanceHandle(); + wndcls.hIcon = g_myApp.LoadIcon(IDI_ICON); + wndcls.hCursor = g_myApp.LoadStandardCursor(IDC_ARROW); + wndcls.hbrBackground = (HBRUSH)(COLOR_3DFACE+1); + wndcls.lpszMenuName = NULL; + + // Specify class name for using FindWindow in the installer + wndcls.lpszClassName = _T("BOINCWindowClass"); + + // Register the new class and exit if it fails + if(!AfxRegisterClass(&wndcls)) return; + // register window class - CString strWndClass = AfxRegisterWndClass (0, g_myApp.LoadStandardCursor(IDC_ARROW), - (HBRUSH)(COLOR_3DFACE+1), g_myApp.LoadIcon(IDI_ICON)); + //CString strWndClass = AfxRegisterWndClass (0, g_myApp.LoadStandardCursor(IDC_ARROW), + // (HBRUSH)(COLOR_3DFACE+1), g_myApp.LoadIcon(IDI_ICON)); // create and position window - CreateEx(0, strWndClass, WND_TITLE, WS_OVERLAPPEDWINDOW|WS_EX_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, + CreateEx(0, wndcls.lpszClassName, WND_TITLE, + WS_OVERLAPPEDWINDOW|WS_EX_OVERLAPPEDWINDOW|WS_CLIPCHILDREN, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL); @@ -980,6 +1000,16 @@ void CMainWindow::OnClose() ShowWindow(SW_HIDE); } +////////// +// CMainWindow::OnDestroy +// arguments: void +// returns: void +// function: quits the program +void CMainWindow::OnDestroy() +{ + OnCommandExit(); +} + ////////// // CMainWindow::OnCommandSettingsLogin // arguments: void @@ -1276,7 +1306,10 @@ void CMainWindow::OnCommandExit() SaveUserSettings(); SaveListControls(); - delete m_pSSWnd; + // This was causing trouble in the installer because the SS window + // would recieve the WM_DESTROY message first, thereby causing + // this delete to access already freed memory + //delete m_pSSWnd; CWnd::OnClose(); } diff --git a/client/win/wingui_mainwindow.h b/client/win/wingui_mainwindow.h index 513b12618d..0895abd7ea 100755 --- a/client/win/wingui_mainwindow.h +++ b/client/win/wingui_mainwindow.h @@ -130,6 +130,7 @@ protected: LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam); afx_msg void OnClose(); + afx_msg void OnDestroy(); afx_msg void OnCommandSettingsQuit(); afx_msg void OnCommandSettingsLogin(); afx_msg void OnCommandSettingsProxyServer(); diff --git a/todo b/todo index 2477630a4c..7df07755c1 100755 --- a/todo +++ b/todo @@ -12,9 +12,6 @@ icon the window is still minimized - a bit confusing. 4. two Solaris Sun Solaris 1.01 clients in the astropulse download page. -5. 1.01 install - failed with ugly -115 error (trying to overwrite the -boinc .dll file) because BOINC was already running during install. - 6. get preferences works, but is slightly confusing - you have to go to projects, right click on "get preferences", and then exit/restart boinc before I get to see my new pretty underwater colors. @@ -59,7 +56,6 @@ deleted. in transfers tab when failure occurs - GUI: Result status should say "downloading files", "uploading files", etc. - message window should reposition to bottom when new message -- show_message should expect \n, discard it if GUI - Win GUI: line between menus and tabs - "show graphics" should not use right-click - win GUI: reduce flicker? diff --git a/win_build/boinc_cli/boinc_cli.dsp b/win_build/boinc_cli/boinc_cli.dsp index 4a7bb35da6..acf60b0436 100755 --- a/win_build/boinc_cli/boinc_cli.dsp +++ b/win_build/boinc_cli/boinc_cli.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # 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=00 /D "WIN_CLI" /YX /FD /c /Tp +# 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=01 /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 @@ -70,7 +70,7 @@ LINK32=link.exe # 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 /GX /ZI /Od /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=00 /D "WIN_CLI" /FR /YX /FD /GZ /c /Tp +# ADD CPP /nologo /MT /W3 /GX /ZI /Od /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=01 /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" diff --git a/win_build/boinc_gui/boinc_gui.dsp b/win_build/boinc_gui/boinc_gui.dsp index 25dbc923ab..56d27196fa 100755 --- a/win_build/boinc_gui/boinc_gui.dsp +++ b/win_build/boinc_gui/boinc_gui.dsp @@ -43,7 +43,7 @@ RSC=rc.exe # 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=00 /YX /FD /c /Tp +# 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=01 /YX /FD /c /Tp # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -70,7 +70,7 @@ LINK32=link.exe # 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 /MTd /W3 /GX /ZI /Od /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=00 /FR /YX /FD /GZ /c /Tp +# ADD CPP /nologo /MTd /W3 /GX /ZI /Od /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=01 /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"