From 321d76a440a308aa0d9b6bae146f779ec8895423 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 21 Jan 2022 14:14:54 +0200 Subject: [PATCH] Ability to hide the "Properties" item from the taskbar context menu --- CHANGELOG.md | 1 + ExplorerPatcher/dllmain.c | 40 +++++++++++++++++++++++++----------- ExplorerPatcher/settings.reg | 2 ++ version.h | 6 +++--- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5fb9c6..9c7c84a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Tested on OS build 22000.434. * Option to disable `Office` hotkeys (`Ctrl`+`Alt`+`Shift`+`Windows` key combinations) (#661) (.4) * Simple Window Switcher can switch applications instead of windows (#665) (.5, .6) * Option to disable rounded corners for windows (.7) +* Ability to hide the "Properties" item from the taskbar context menu (.9) #### Feature enhancements diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index bc30667..d0e0302 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -82,6 +82,7 @@ BOOL bDoNotRedirectProgramsAndFeaturesToSettingsApp = FALSE; BOOL bDoNotRedirectDateAndTimeToSettingsApp = FALSE; BOOL bDoNotRedirectNotificationIconsToSettingsApp = FALSE; BOOL bDisableOfficeHotkeys = FALSE; +DWORD bNoPropertiesInContextMenu = FALSE; #define TASKBARGLOMLEVEL_DEFAULT 2 #define MMTASKBARGLOMLEVEL_DEFAULT 2 DWORD dwTaskbarGlomLevel = TASKBARGLOMLEVEL_DEFAULT; @@ -1447,12 +1448,15 @@ HMENU explorer_LoadMenuW(HINSTANCE hInstance, LPCWSTR lpMenuName) menuInfo.fType = MFT_STRING; menuInfo.dwTypeData = buffer; menuInfo.cch = wcslen(buffer); - InsertMenuItemW( - hSubMenu, - GetMenuItemCount(hSubMenu) - 4, - TRUE, - &menuInfo - ); + if (!bNoPropertiesInContextMenu) + { + InsertMenuItemW( + hSubMenu, + GetMenuItemCount(hSubMenu) - 4, + TRUE, + &menuInfo + ); + } } } return hMenu; @@ -1764,12 +1768,15 @@ INT64 Shell_TrayWndSubclassProc( menuInfo.fType = MFT_STRING; menuInfo.dwTypeData = buffer; menuInfo.cch = wcslen(buffer); - InsertMenuItemW( - hSubMenu, - GetMenuItemCount(hSubMenu) - 1, - TRUE, - &menuInfo - ); + if (!bNoPropertiesInContextMenu) + { + InsertMenuItemW( + hSubMenu, + GetMenuItemCount(hSubMenu) - 1, + TRUE, + &menuInfo + ); + } INT64* unknown_array = NULL; if (bSkinMenus) @@ -4363,6 +4370,15 @@ void WINAPI LoadSettings(LPARAM lParam) &dwSize ); dwSize = sizeof(DWORD); + RegQueryValueExW( + hKey, + TEXT("NoPropertiesInContextMenu"), + 0, + NULL, + &bNoPropertiesInContextMenu, + &dwSize + ); + dwSize = sizeof(DWORD); RegQueryValueExW( hKey, TEXT("NoMenuAccelerator"), diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index 790991f..6d7dd53 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -433,6 +433,8 @@ ;d Enable SysListView32 for Explorer views * @="" [HKEY_CURRENT_USER\Software\ExplorerPatcher] +;b Do not show the program settings item ("Properties") in the taskbar context menu +"NoPropertiesInContextMenu"=dword:00000000 ;b Enable symbols download * "EnableSymbolDownload"=dword:00000001 ;i Do not hook Start menu from main Explorer process (permanently disabled) * diff --git a/version.h b/version.h index ac985f9..7b3f325 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22000 #define VER_MINOR 434 #define VER_BUILD_HI 41 -#define VER_BUILD_LO 8 +#define VER_BUILD_LO 9 #define VER_FLAGS VS_FF_PRERELEASE @@ -12,5 +12,5 @@ #define VER_STR(arg) #arg // The String form of the version numbers -#define VER_FILE_STRING VALUE "FileVersion", "22000.434.41.8" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.434.41.8" +#define VER_FILE_STRING VALUE "FileVersion", "22000.434.41.9" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.434.41.9"