From c359410f44239e5b2de4c07bab53fd6c50f5c903 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Thu, 9 Sep 2004 04:22:43 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4167 --- checkin_notes | 7 +++++++ client/file_names.C | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/checkin_notes b/checkin_notes index 193a8583a2..36e4a68484 100755 --- a/checkin_notes +++ b/checkin_notes @@ -17122,3 +17122,10 @@ David 7 Sept 2004 client/ hostinfo_unix.C + +Rom 8 Sep 2004 + - If we can lock the lockfile, also aquire the global mutex. If we don't the screensaver + cannot properly detect that BOINC is executing. + + client/ + file_names.C diff --git a/client/file_names.C b/client/file_names.C index 71beee68fb..05235c480b 100644 --- a/client/file_names.C +++ b/client/file_names.C @@ -21,6 +21,7 @@ #ifdef _WIN32 #include "boinc_win.h" +#include "win_util.h" #endif #ifndef _WIN32 @@ -127,6 +128,17 @@ int check_unique_instance() { if (lock_file(LOCK_FILE_NAME)) { return ERR_ALREADY_RUNNING; } +#ifdef _WIN32 + else + { + HANDLE h = CreateMutex(NULL, true, RUN_MUTEX); + if ((h==0) || (GetLastError() == ERROR_ALREADY_EXISTS)) { + UINT nShowMsg = RegisterWindowMessage(SHOW_WIN_MSG); + PostMessage(HWND_BROADCAST, nShowMsg, 0, 0); + return FALSE; + } + } +#endif #else key_t key; char path[256];