From: Alexander Steinhöfer Date: Fri, 24 Apr 2020 10:30:06 +0000 (+0200) Subject: Enabled Spectre Migitations. Small menu tweaks. X-Git-Tag: 1.4.6~1 X-Git-Url: https://repos.lx-s.de/gitweb/?a=commitdiff_plain;h=839346f67d631a0c65d78846379f038404a48739;p=winmute.git Enabled Spectre Migitations. Small menu tweaks. --- diff --git a/Build/bin/changelog.txt b/Build/bin/changelog.txt index 26ab695..315b109 100644 --- a/Build/bin/changelog.txt +++ b/Build/bin/changelog.txt @@ -1,4 +1,9 @@ -Verion 1.4.5 (2019-09-04) +Version 1.4.6 (2020-04-24) + * Compiled with spectre migitations... just 'cause + * Added "Support"-Link to About dialog + * Small menu redesign. + +Version 1.4.5 (2019-09-04) * Fixed crash when all audio endpoints are removed while the program is running (might happen, when connecting to your PC via RDP). * Upgraded compiler toolset to VS2019 diff --git a/Build/bin/liesmich.html b/Build/bin/liesmich.html index 79190a9..311d4ed 100644 --- a/Build/bin/liesmich.html +++ b/Build/bin/liesmich.html @@ -2,7 +2,7 @@ - WinMute 1.4.5 - Lies mich + WinMute 1.4.6 - Lies mich -

WinMute 1.4.5

- +

WinMute 1.4.6

+

Über

WinMute schaltet Windows stumm, sobald sie ihren PC sperren oder sich der Bildschirmschoner einschaltet.

diff --git a/Build/bin/readme.html b/Build/bin/readme.html index 7b4bfa9..b402373 100644 --- a/Build/bin/readme.html +++ b/Build/bin/readme.html @@ -2,7 +2,7 @@ - WinMute 1.4.5 - Readme + WinMute 1.4.6 - Readme -

WinMute 1.4.5

- +

WinMute 1.4.6

+

About

WinMute automatically mutes your PC volume if you lock your screen or the screensaver is running.

diff --git a/Build/bin/WinMute.exe.gui b/Build/bin/x64/WinMute.exe.gui similarity index 100% rename from Build/bin/WinMute.exe.gui rename to Build/bin/x64/WinMute.exe.gui diff --git a/Build/bin/x86/WinMute.exe.gui b/Build/bin/x86/WinMute.exe.gui new file mode 100644 index 0000000..e69de29 diff --git a/ScreensaverNotify/ScreensaverNotify.vcxproj b/ScreensaverNotify/ScreensaverNotify.vcxproj index d992ba4..a953a0d 100644 --- a/ScreensaverNotify/ScreensaverNotify.vcxproj +++ b/ScreensaverNotify/ScreensaverNotify.vcxproj @@ -44,6 +44,7 @@ v142 true Unicode + Spectre DynamicLibrary @@ -51,6 +52,7 @@ v142 true Unicode + Spectre diff --git a/WinMute.sln b/WinMute.sln index 21f83a4..5da6b48 100644 --- a/WinMute.sln +++ b/WinMute.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinMute", "WinMute\WinMute.vcxproj", "{488617F0-5DD3-42B5-81ED-A1E9B3117551}" ProjectSection(ProjectDependencies) = postProject @@ -32,9 +32,13 @@ Global {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Debug|x64.Build.0 = Debug|x64 {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Release|Win32.ActiveCfg = Release|Win32 {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Release|Win32.Build.0 = Release|Win32 - {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Release|x64.ActiveCfg = Release|Win32 + {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Release|x64.ActiveCfg = Release|x64 + {A48C241D-70F5-4919-BE06-8C5BE99CCC23}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AE62E32B-8E8B-4236-9173-9671A647A778} + EndGlobalSection EndGlobal diff --git a/WinMute/AboutDlg.cpp b/WinMute/AboutDlg.cpp index 67207d3..c872dc0 100644 --- a/WinMute/AboutDlg.cpp +++ b/WinMute/AboutDlg.cpp @@ -43,14 +43,15 @@ INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) EndDialog(hDlg, 0); } return 0; - case WM_NOTIFY: - switch (((LPNMHDR)lParam)->code) { + case WM_NOTIFY: { + PNMLINK pNmLink = (PNMLINK)lParam; + switch (pNmLink->hdr.code) { case NM_CLICK: case NM_RETURN: { - PNMLINK pNMLink = (PNMLINK)lParam; - LITEM item = pNMLink->item; - if ((((LPNMHDR)lParam)->idFrom == IDC_LINK_HOMEPAGE) && - (item.iLink == 0)) { + UINT_PTR ctrlId = pNmLink->hdr.idFrom; + LITEM item = pNmLink->item; + if ((ctrlId == IDC_LINK_HOMEPAGE || ctrlId == IDC_LINK_SUPPORT) + && item.iLink == 0) { ShellExecute(nullptr, _T("open"), item.szUrl, nullptr, nullptr, SW_SHOW); } @@ -58,6 +59,7 @@ INT_PTR CALLBACK AboutDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) } } return TRUE; + } case WM_CLOSE: EndDialog(hDlg, 0); return TRUE; diff --git a/WinMute/Utility.cpp b/WinMute/Utility.cpp index 83b12fe..6df2e16 100644 --- a/WinMute/Utility.cpp +++ b/WinMute/Utility.cpp @@ -41,18 +41,19 @@ void PrintWindowsError(LPTSTR lpszFunction, DWORD lastError) } LPVOID lpMsgBuf; - if (FormatMessage( - FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - nullptr, lastError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - reinterpret_cast(&lpMsgBuf), 0, nullptr) != 0) { - + if (FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, lastError, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + reinterpret_cast(&lpMsgBuf), 0, nullptr) != 0) { + size_t displayBufSize = + ((size_t)lstrlen(static_cast(lpMsgBuf)) + + (size_t)lstrlen(static_cast(lpszFunction)) + + 40) * sizeof(TCHAR); // Display the error message and exit the process - LPVOID lpDisplayBuf = reinterpret_cast(LocalAlloc(LMEM_ZEROINIT, - (lstrlen(static_cast(lpMsgBuf)) + - lstrlen(static_cast(lpszFunction)) + 40) - * sizeof(TCHAR))); + LPVOID lpDisplayBuf = reinterpret_cast( + LocalAlloc(LMEM_ZEROINIT, displayBufSize)); if (lpDisplayBuf) { StringCchPrintf((LPTSTR)lpDisplayBuf, LocalSize(lpDisplayBuf), diff --git a/WinMute/WinMute.vcxproj b/WinMute/WinMute.vcxproj index dd56a06..61011fb 100644 --- a/WinMute/WinMute.vcxproj +++ b/WinMute/WinMute.vcxproj @@ -30,12 +30,14 @@ Unicode true v142 + Spectre Application Unicode true v142 + Spectre Application @@ -170,6 +172,7 @@ true true Caret + Guard strsafe.lib;comctl32.lib;WtsApi32.lib;Winmm.lib;%(AdditionalDependencies) @@ -197,6 +200,7 @@ Caret true true + Guard strsafe.lib;comctl32.lib;WtsApi32.lib;Winmm.lib;%(AdditionalDependencies) diff --git a/WinMute/res.rc b/WinMute/res.rc index 6df6c95..c0e7bad 100644 --- a/WinMute/res.rc +++ b/WinMute/res.rc @@ -25,18 +25,18 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -60,7 +60,8 @@ BEGIN MENUITEM "... Workstation is locked", ID_TRAYMENU_MUTEONLOCK, CHECKED MENUITEM "... Screensaver starts", ID_TRAYMENU_MUTEONSCREENSAVER, CHECKED MENUITEM SEPARATOR - MENUITEM "Restore volume", ID_TRAYMENU_RESTOREAUDIO, CHECKED + MENUITEM "Afterwards...", ID_TRAYMENU_AFTERWARDS, INACTIVE + MENUITEM "... Restore volume", ID_TRAYMENU_RESTOREAUDIO, CHECKED MENUITEM SEPARATOR MENUITEM "Mute now", ID_TRAYMENU_MUTE MENUITEM SEPARATOR @@ -74,17 +75,19 @@ END // Dialog // -IDD_ABOUT DIALOGEX 0, 0, 251, 52 +IDD_ABOUT DIALOGEX 0, 0, 251, 56 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION CAPTION "About WinMute" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "OK",IDOK,194,7,50,14 - LTEXT "WinMute v1.4.5",IDC_STATIC,43,9,67,11 + LTEXT "WinMute v1.4.6",IDC_STATIC,43,9,67,11 CONTROL "lx-systems - lx-s.de",IDC_LINK_HOMEPAGE, - "SysLink",WS_TABSTOP,43,31,69,13 - LTEXT "Copyright © 2019, Alexander Steinhöfer",IDC_STATIC,43,20,148,12 - ICON IDI_APP,IDC_STATIC,13,9,21,20,SS_CENTERIMAGE + "SysLink",WS_TABSTOP,43,35,69,13 + LTEXT "Copyright © 2016, Alexander Steinhöfer",IDC_STATIC,43,22,148,12 + ICON IDI_APP,IDC_STATIC,13,12,21,20,SS_CENTERIMAGE + CONTROL "Support",IDC_LINK_SUPPORT, + "SysLink",WS_TABSTOP,119,35,36,13 END @@ -102,7 +105,7 @@ BEGIN RIGHTMARGIN, 244 VERTGUIDE, 43 TOPMARGIN, 7 - BOTTOMMARGIN, 45 + BOTTOMMARGIN, 49 END END #endif // APSTUDIO_INVOKED @@ -114,8 +117,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,4,5,0 - PRODUCTVERSION 1,4,5,0 + FILEVERSION 1,4,6,0 + PRODUCTVERSION 1,4,6,0 FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -132,23 +135,23 @@ BEGIN BEGIN VALUE "CompanyName", "lx-systems" VALUE "FileDescription", "Automatic volume muting, when PC is locked." - VALUE "FileVersion", "1.4.5.0" + VALUE "FileVersion", "1.4.6.0" VALUE "InternalName", "WinMute" - VALUE "LegalCopyright", "Copyright (c) 2019, Alexander Steinhöfer" + VALUE "LegalCopyright", "Copyright (c) 2020, Alexander Steinhöfer" VALUE "OriginalFilename", "WinMute.exe" VALUE "ProductName", "WinMute" - VALUE "ProductVersion", "1.4.5.0" + VALUE "ProductVersion", "1.4.6.0" END BLOCK "040704b0" BEGIN VALUE "CompanyName", "lx-systems" VALUE "FileDescription", "Automatisches Stummschalten beim Sperren der Workstation." - VALUE "FileVersion", "1.4.5.0" + VALUE "FileVersion", "1.4.6.0" VALUE "InternalName", "WinMute" - VALUE "LegalCopyright", "Copyright (c) 2019, Alexander Steinhöfer" + VALUE "LegalCopyright", "Copyright (c) 2020, Alexander Steinhöfer" VALUE "OriginalFilename", "WinMute.exe" VALUE "ProductName", "WinMute" - VALUE "ProductVersion", "1.4.5.0" + VALUE "ProductVersion", "1.4.6.0" END END BLOCK "VarFileInfo" diff --git a/WinMute/resource.h b/WinMute/resource.h index 5c59479..9c34587 100644 --- a/WinMute/resource.h +++ b/WinMute/resource.h @@ -8,6 +8,8 @@ #define IDI_ICON1 107 #define IDI_TRAY 107 #define IDC_LINK_HOMEPAGE 1001 +#define IDC_LINK_HOMEPAGE2 1002 +#define IDC_LINK_SUPPORT 1002 #define ID_TRAYMENU_INFO 40001 #define ID_TRAYMENU_EXIT 40002 #define ID_TRAYMENU_MUTEONLOCK 40003 @@ -20,13 +22,14 @@ #define ID_TRAYMENU_40010 40010 #define ID_TRAYMENU_40011 40011 #define ID_TRAYMENU_MUTEON 40012 +#define ID_TRAYMENU_AFTERWARDS 40013 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 108 -#define _APS_NEXT_COMMAND_VALUE 40013 +#define _APS_NEXT_COMMAND_VALUE 40014 #define _APS_NEXT_CONTROL_VALUE 1002 #define _APS_NEXT_SYMED_VALUE 101 #endif