diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..45dc844 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,62 @@ +# Explorer Patcher Changelog + +This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub. + +## 22000.168.0.6 + +Fixes [#5](https://github.com/valinet/ExplorerPatcher/issues/5) (removes the delay at logon on newer builds like 22000.168; the bug is similar to the effect introduced by `UndockingDisabled` on these newer builds). + +## 22000.1.0.5 + +Offsets are now determined at runtime + +The application was tested on builds 22000.1 and 22000.168. + +- Library downloads and parses symbols in order to determine + function hooking offsets at runtime and saves the data in a + "settings.ini" file located in the application folder for future + use; the file is invalidated when a new OS build is detected +- The main executable attempts to determine the location where a + jump has to be patched out so that Explorer remains on the 'show + old taskbar' code path; it will systematically patch each jz/jnz + instruction and will check whether Explorer still runs fine, and, + if it does so and does not crash, whether the old taskbar got + actually shown; once the offset is determined, it is saved in the + "settings.ini" file for future use +- Please have an unmetered active working Internet connection when + running for the first time +- Messages from the patcher (i.e. install/uninstall successful + message, symbol downloading message) will now display in a toast + (Windows 10 notification) if possible; when Explorer is not + running, it falls back to using standard MessageBox'es +- Disabled the pre/post build command that restarted sihost.exe in + Debug builds + +## 22000.1.0.4 + +New in this release + +- Win+X combination is now handled and opens the power user menu + +Of note from previous releases: + +- Start menu is now displayed on monitor containing the cursor when invoked with the Windows key if the appropriate configuration is made into the registry (enables a functionality which was previously available in Windows 8.1). To activate this, follow this tutorial: https://www.tenforums.com/tutorials/5943-start-menu-open-main-last-display-windows-10-a.html +- The power user menu (Win+X) is now skinned using the system theme, as it was in Windows 10 + +## 22000.1.0.3 + +Start menu is now displayed on monitor containing the cursor when invoked with the Windows key if the appropriate configuration is made into the registry (enables a functionality which was previously available in Windows 8.1). + +To activate this, follow this tutorial: https://www.tenforums.com/tutorials/5943-start-menu-open-main-last-display-windows-10-a.html + +## 22000.1.0.2 + +Fixes [#1](https://github.com/valinet/ExplorerPatcher/issues/1) (the menu is now skinned using the system theme, as it was in Windows 10). + +## 22000.1.0.1 + +Added functionality to bring back the power user menu (Win+X). + +## 22000.1.0.0 + +Initial version of the application. Only x64 builds. \ No newline at end of file diff --git a/ExplorerPatcher/ExplorerPatcher.rc b/ExplorerPatcher/ExplorerPatcher.rc index c8d4524..a30cacc 100644 --- a/ExplorerPatcher/ExplorerPatcher.rc +++ b/ExplorerPatcher/ExplorerPatcher.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 22000,1,0,5 - PRODUCTVERSION 22000,1,0,5 + FILEVERSION 22000,168,0,6 + PRODUCTVERSION 22000,168,0,6 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "VALINET Solutions SRL" VALUE "FileDescription", "ExplorerPatcher Daemon" - VALUE "FileVersion", "22000.1.0.5" + VALUE "FileVersion", "22000.168.0.6" VALUE "InternalName", "ExplorerPatcher.exe" VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved." VALUE "OriginalFilename", "ExplorerPatcher.exe" VALUE "ProductName", "ExplorerPatcher" - VALUE "ProductVersion", "22000.1.0.5" + VALUE "ProductVersion", "22000.168.0.6" END END BLOCK "VarFileInfo" diff --git a/ExplorerPatcher/main.c b/ExplorerPatcher/main.c index 6ebfba4..5dd632e 100644 --- a/ExplorerPatcher/main.c +++ b/ExplorerPatcher/main.c @@ -964,6 +964,14 @@ int WINAPI wWinMain( // hExplorer, // INFINITE // ); + /*for (UINT i = 0; i < 7; ++i) + { + TCHAR title[200], className[200]; + GetWindowTextW(GetForegroundWindow(), title, 200); + GetClassNameW(GetForegroundWindow(), className, 200); + wprintf(L"%s %s\n", title, className); + Sleep(1000); + }*/ } CloseHandle(hExplorer); } @@ -990,7 +998,35 @@ int WINAPI wWinMain( szLibPath, L"\\ExplorerPatcherLibrary.dll" ); - Sleep(DELAY); + //Sleep(DELAY); + + while (TRUE) + { + HWND hWnd = FindWindowEx( + NULL, + NULL, + L"Shell_TrayWnd", + NULL + ); + if (hWnd) + { + hWnd = FindWindowEx( + hWnd, + NULL, + L"Start", + NULL + ); + if (hWnd) + { + if (IsWindowVisible(hWnd)) + { + break; + } + } + } + Sleep(1); + } + CreateThread( 0, 0, diff --git a/ExplorerPatcherLibrary/ExplorerPatcherLibrary.rc b/ExplorerPatcherLibrary/ExplorerPatcherLibrary.rc index 128e4db..9972fdc 100644 --- a/ExplorerPatcherLibrary/ExplorerPatcherLibrary.rc +++ b/ExplorerPatcherLibrary/ExplorerPatcherLibrary.rc @@ -51,8 +51,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 22000,1,0,5 - PRODUCTVERSION 22000,1,0,5 + FILEVERSION 22000,168,0,6 + PRODUCTVERSION 22000,168,0,6 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -69,12 +69,12 @@ BEGIN BEGIN VALUE "CompanyName", "VALINET Solutions SRL" VALUE "FileDescription", "ExplorerPatcher Library" - VALUE "FileVersion", "22000.1.0.5" + VALUE "FileVersion", "22000.168.0.6" VALUE "InternalName", "ExplorerPatcherLibrary.dll" VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved." VALUE "OriginalFilename", "ExplorerPatcherLibrary.dll" VALUE "ProductName", "WinOverview" - VALUE "ProductVersion", "22000.1.0.5" + VALUE "ProductVersion", "22000.168.0.6" END END BLOCK "VarFileInfo" diff --git a/ExplorerPatcherLibrary/dllmain.c b/ExplorerPatcherLibrary/dllmain.c index 2fe3562..8eda31a 100644 --- a/ExplorerPatcherLibrary/dllmain.c +++ b/ExplorerPatcherLibrary/dllmain.c @@ -946,6 +946,14 @@ __declspec(dllexport) DWORD WINAPI main( int rv; if (!funchook) { + HANDLE hEvent = CreateEvent(0, 1, 1, L"ShellDesktopSwitchEvent"); + if (hEvent) + { + SetEvent(hEvent); + } + + + messageWindow = (HWND)lpParameter; @@ -1520,6 +1528,11 @@ __declspec(dllexport) DWORD WINAPI main( FreeLibraryAndExitThread(hModule, rv); return rv; } + + + + + } else { diff --git a/PostBuildCommand/PostBuildCommand.vcxproj b/PostBuildCommand/PostBuildCommand.vcxproj index af2b2c4..30abf73 100644 --- a/PostBuildCommand/PostBuildCommand.vcxproj +++ b/PostBuildCommand/PostBuildCommand.vcxproj @@ -63,10 +63,10 @@ - taskkill /f /im:sihost.exe 2>nul &set errorlevel=0 + rem taskkill /f /im:sihost.exe 2>nul &set errorlevel=0 PostBuildCommand.exe NDEBUG;$(NMakePreprocessorDefinitions) - taskkill /f /im:sihost.exe 2>nul &set errorlevel=0 + rem taskkill /f /im:sihost.exe 2>nul &set errorlevel=0 rem taskkill /f /im:sihost.exe 2>nul &set errorlevel=0 diff --git a/README.md b/README.md index afe8ca6..10cb2af 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,14 @@ Explorer Patcher is a patcher that enables various stuff in Explorer. For the mo * enables the power user menu (Win+X) when using the classic taskbar in Windows 11 * shows the Start menu on the monitor containing the cursor when invoked with the Windows key -This has been tested only on Windows 11 build 22000.1. ~~It probably does not work on other builds due to different offsets in explorer.exe and its libraries. Once this matures, a solution will be offered for dynamically determining the necessary offsets. As it stands, the application is more in a proof of concept phase.~~ It should work on higher builds, provided that the OS components' structure has not changed too drastically. The library is able to automatically download symbols and determine the offsets for correctly hooking the functions. +This heas been tested on the following builds: + +* 22000.1 - works as advertised, tested with `Start_ShowClassicMode` which shows the Windows 10 Start menu; taskbar works, Win+X works and is skinned, WiFi flyout works, battery flyout works, no delay at logon +* 22000.168 - works as advertised, Start button opens Windows 11 Start menu (a half broken Windows 10 menu can be restored by copying `StartMenuExperienceHost.exe` and its DLLs from 22000.1); taskbar works, Win+X works and is skinned, WiFi flyout DOES NOT work (use control center aka gear icon or [enable Windows 8 network flyout](https://winaero.com/change-network-icon-click-action-in-windows-10/?utm_source=software&utm_medium=in-app&utm_campaign=winaerotweaker&utm_content=networkflyout) instead, battery flyout DOES NOT work (use [Battery Mode](https://en.bmode.tarcode.ru/) utility), control center icon works, no delay at logon (!!!) + +It should work on newer builds as well as long as the internal structure does not change too much (hopefully they don't remove all the legacy code), I am rolling with them at the moment and try to keep it working on the most recent CU (as of this time, 22000.168). + +A changelog is available [here](https://github.com/valinet/ExplorerPatcher/blob/master/CHANGELOG.md). A detailed description of how this works is available on my web site [here](https://valinet.ro/2021/08/09/Restore-Windows-11-to-working-Windows-10-UI.html).