Fixed windows 95 family screen saver stuff.

This commit is contained in:
crs 2004-03-28 14:06:40 +00:00
parent bf7643faab
commit 0f7fa2dfd9
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,7 @@
#endif #endif
static const TCHAR* g_isSecureNT = "ScreenSaverIsSecure"; static const TCHAR* g_isSecureNT = "ScreenSaverIsSecure";
static const TCHAR* g_isSecure9x = "ScreenSaverUsePassword"; static const TCHAR* g_isSecure9x = "ScreenSaveUsePassword";
static const TCHAR* const g_pathScreenSaverIsSecure[] = { static const TCHAR* const g_pathScreenSaverIsSecure[] = {
"Control Panel", "Control Panel",
"Desktop", "Desktop",
@ -162,6 +162,7 @@ CMSWindowsScreenSaver::activate()
{ {
// don't activate if already active // don't activate if already active
if (!isActive()) { if (!isActive()) {
// activate
HWND hwnd = GetForegroundWindow(); HWND hwnd = GetForegroundWindow();
if (hwnd != NULL) { if (hwnd != NULL) {
PostMessage(hwnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0); PostMessage(hwnd, WM_SYSCOMMAND, SC_SCREENSAVE, 0);
@ -451,12 +452,14 @@ CMSWindowsScreenSaver::isSecure(bool* wasSecureFlagAnInt) const
switch (CArchMiscWindows::typeOfValue(hkey, isSecure)) { switch (CArchMiscWindows::typeOfValue(hkey, isSecure)) {
default: default:
result = false; result = false;
break;
case CArchMiscWindows::kUINT: { case CArchMiscWindows::kUINT: {
DWORD value = DWORD value =
CArchMiscWindows::readValueInt(hkey, isSecure); CArchMiscWindows::readValueInt(hkey, isSecure);
*wasSecureFlagAnInt = true; *wasSecureFlagAnInt = true;
result = (value != 0); result = (value != 0);
break;
} }
case CArchMiscWindows::kSTRING: { case CArchMiscWindows::kSTRING: {
@ -464,6 +467,7 @@ CMSWindowsScreenSaver::isSecure(bool* wasSecureFlagAnInt) const
CArchMiscWindows::readValueString(hkey, isSecure); CArchMiscWindows::readValueString(hkey, isSecure);
*wasSecureFlagAnInt = false; *wasSecureFlagAnInt = false;
result = (value != "0"); result = (value != "0");
break;
} }
} }