From 0f7fa2dfd99b193f3945334ee87b0a1ab95bc406 Mon Sep 17 00:00:00 2001 From: crs Date: Sun, 28 Mar 2004 14:06:40 +0000 Subject: [PATCH] Fixed windows 95 family screen saver stuff. --- lib/platform/CMSWindowsScreenSaver.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/platform/CMSWindowsScreenSaver.cpp b/lib/platform/CMSWindowsScreenSaver.cpp index 89090009..6a821281 100644 --- a/lib/platform/CMSWindowsScreenSaver.cpp +++ b/lib/platform/CMSWindowsScreenSaver.cpp @@ -27,7 +27,7 @@ #endif static const TCHAR* g_isSecureNT = "ScreenSaverIsSecure"; -static const TCHAR* g_isSecure9x = "ScreenSaverUsePassword"; +static const TCHAR* g_isSecure9x = "ScreenSaveUsePassword"; static const TCHAR* const g_pathScreenSaverIsSecure[] = { "Control Panel", "Desktop", @@ -162,6 +162,7 @@ CMSWindowsScreenSaver::activate() { // don't activate if already active if (!isActive()) { + // activate HWND hwnd = GetForegroundWindow(); if (hwnd != NULL) { PostMessage(hwnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0); @@ -451,12 +452,14 @@ CMSWindowsScreenSaver::isSecure(bool* wasSecureFlagAnInt) const switch (CArchMiscWindows::typeOfValue(hkey, isSecure)) { default: result = false; + break; case CArchMiscWindows::kUINT: { DWORD value = CArchMiscWindows::readValueInt(hkey, isSecure); *wasSecureFlagAnInt = true; result = (value != 0); + break; } case CArchMiscWindows::kSTRING: { @@ -464,6 +467,7 @@ CMSWindowsScreenSaver::isSecure(bool* wasSecureFlagAnInt) const CArchMiscWindows::readValueString(hkey, isSecure); *wasSecureFlagAnInt = false; result = (value != "0"); + break; } }