From c2f0d7950bf6f6e524b8db167cf5f4709b6db1c5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20Steinh=C3=B6fer?= Date: Mon, 29 Jun 2020 13:20:56 +0200 Subject: [PATCH] Fixed mute on logoff and shutdown. --- WinMute/WinMain.cpp | 2 +- WinMute/WinMute.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/WinMute/WinMain.cpp b/WinMute/WinMain.cpp index 0a9826d..6bffcc2 100644 --- a/WinMute/WinMain.cpp +++ b/WinMute/WinMain.cpp @@ -50,7 +50,7 @@ int WINAPI wWinMain(_In_ HINSTANCE hInstance, nullptr, PROGRAM_NAME, _T("WinMute is already running"), - _T("Please look for a blue speaker icon in your Windows ") + _T("Please look for a white speaker icon in your Windows ") _T(" taskbar notification area."), TDCBF_OK_BUTTON, TD_ERROR_ICON, diff --git a/WinMute/WinMute.cpp b/WinMute/WinMute.cpp index 2536f36..9d4b4a0 100644 --- a/WinMute/WinMute.cpp +++ b/WinMute/WinMute.cpp @@ -100,7 +100,7 @@ bool WinMute::RegisterWindowClass() bool WinMute::InitWindow() { hWnd_ = CreateWindowEx(WS_EX_TOOLWINDOW, WINMUTE_CLASS_NAME, PROGRAM_NAME, - WS_POPUP, 0, 0, 0, 0, HWND_MESSAGE, 0, hglobInstance, this); + WS_POPUP, 0, 0, 0, 0, NULL, 0, hglobInstance, this); if (hWnd_ == nullptr) { PrintWindowsError(_T("CreateWindowEx")); return false; @@ -346,7 +346,7 @@ LRESULT CALLBACK WinMute::WindowProc(HWND hWnd, UINT msg, if (muteConfig_.noRestore.onShutdown) { audio_->Mute(); } - } else if (lParam == ENDSESSION_LOGOFF) { + } else if ((lParam & ENDSESSION_LOGOFF)) { if (muteConfig_.noRestore.onLogoff) { audio_->Mute(); } -- 2.43.0