From: Alexander Steinhöfer Date: Thu, 7 Apr 2022 08:20:03 +0000 (+0200) Subject: Fixed Screensaver detection. X-Git-Tag: 1.9.9~6 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=156a60ae779a4b775a077a62bdb84254f9b3f724;p=winmute.git Fixed Screensaver detection. --- diff --git a/ScreensaverNotify/ScreensaverNotify.cpp b/ScreensaverNotify/ScreensaverNotify.cpp index fd8c3ea..3d6bdfa 100644 --- a/ScreensaverNotify/ScreensaverNotify.cpp +++ b/ScreensaverNotify/ScreensaverNotify.cpp @@ -32,10 +32,11 @@ POSSIBILITY OF SUCH DAMAGE. */ #pragma once - +#define _CRT_SECURE_NO_WARNINGS #include #include #include "ScreensaverNotify.h" +#include /* ============================================================================= DLL Globals @@ -107,10 +108,11 @@ extern "C" { switch (reason) { case DLL_PROCESS_ATTACH: hglobInstance_ = hInstance; - DisableThreadLibraryCalls(hInstance); + if (!DisableThreadLibraryCalls(hInstance)) { + return FALSE; + } break; case DLL_PROCESS_DETACH: - UnregisterScreensaverHook(); break; default: break; diff --git a/WinMute/ScreensaverNotifier.cpp b/WinMute/ScreensaverNotifier.cpp index 50526ea..ab39e97 100644 --- a/WinMute/ScreensaverNotifier.cpp +++ b/WinMute/ScreensaverNotifier.cpp @@ -290,10 +290,10 @@ bool ScreensaverNotifier::IsScreensaverRunning() { BOOL isRunning = FALSE; if (SystemParametersInfo( - SPI_GETSCREENSAVERRUNNING, - 0, - &isRunning, - FALSE) == FALSE) { + SPI_GETSCREENSAVERRUNNING, + 0, + &isRunning, + FALSE) == FALSE) { PrintWindowsError(_T("SystemParametersInfo")); return false; }