From 0c2f287d5754b7fa64abca6af7dff062b88ab05f Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Sun, 7 Aug 2022 02:30:47 +0300 Subject: [PATCH] GUI, Main: Support for File Explorer - Control interface setting on OS builds 22621+ --- ExplorerPatcher/dllmain.c | 11 ++++++++--- ExplorerPatcher/settings.reg | 2 -- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 30663dd..573b1c3 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -1909,6 +1909,7 @@ DWORD FixTaskbarAutohide(DWORD unused) #pragma region "EnsureXAML on OS builds 22621+" +#ifdef _WIN64 DEFINE_GUID(uuidof_Windows_Internal_Shell_XamlExplorerHost_IXamlApplicationStatics, 0xECC13292, 0x27EF, 0x547A, 0xAC, 0x8B, 0x76, 0xCD, 0x17, 0x32, 0x21, 0x86); @@ -2041,6 +2042,7 @@ HMODULE __fastcall Windows11v22H2_combase_LoadLibraryExW(LPCWSTR lpLibFileName, } return hModule; } +#endif #pragma endregion @@ -8523,24 +8525,27 @@ HRESULT shell32_DriveTypeCategorizer_CreateInstanceHook(IUnknown* pUnkOuter, REF return shell32_DriveTypeCategorizer_CreateInstanceFunc(pUnkOuter, riid, ppvObject); } - +#endif #pragma endregion -#pragma region "Disable ribbon in File Explorer" +#pragma region "File Explorer command bar and ribbon support" DEFINE_GUID(CLSID_UIRibbonFramework, 0x926749FA, 0x2615, 0x4987, 0x88, 0x45, 0xC3, 0x3E, 0x65, 0xF2, 0xB9, 0x57); DEFINE_GUID(IID_UIRibbonFramework, 0xF4F0385D, 0x6872, 0x43A8, 0xAD, 0x09, 0x4C, 0x33, 0x9C, 0xB3, 0xF5, 0xC5); HRESULT ExplorerFrame_CoCreateInstanceHook(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID riid, LPVOID* ppv) { + if ((dwFileExplorerCommandUI != 0) && *(INT64*)&rclsid->Data1 == 0x4D1E5A836480100B && *(INT64*)rclsid->Data4 == 0x339A8EA8E58A699F) + { + return REGDB_E_CLASSNOTREG; + } if (dwFileExplorerCommandUI == 2 && IsEqualCLSID(rclsid, &CLSID_UIRibbonFramework) && IsEqualIID(riid, &IID_UIRibbonFramework)) { return REGDB_E_CLASSNOTREG; } return CoCreateInstance(rclsid, pUnkOuter, dwClsContext, riid, ppv); } -#endif #pragma endregion diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index 603c6a8..b838f4b 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -206,14 +206,12 @@ [HKEY_CURRENT_USER\Software\ExplorerPatcher] ;b Use classic drive groupings in This PC "UseClassicDriveGrouping"=dword:00000000 -;s Explorer_ControlInterface !IsWindows11Version22H2OrHigher [HKEY_CURRENT_USER\Software\ExplorerPatcher] ;c 3 Control Interface * ;x 0 Windows 11 Command Bar (default) ;x 1 Windows 10 Ribbon ;x 2 Windows 7 Command Bar ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_FileExplorerCommandUI"=dword:00000000 -;g Explorer_ControlInterface ;t The following settings take effect on newly created File Explorer windows: [HKEY_CURRENT_USER\Software\ExplorerPatcher] ;i Use immersive menus when displaying Windows 10 context menus **