Browse Source

Merge remote-tracking branch 'refs/remotes/origin/master'

# Conflicts:
#	.github/workflows/build.yml
pull/3551/head
Amrsatrio 1 year ago
parent
commit
1fcd7d7322
  1. 46
      .github/workflows/build.yml
  2. 12
      CHANGELOG.md
  3. 71
      ExplorerPatcher/ImmersiveColor.h
  4. 28
      ExplorerPatcher/dllmain.c
  5. 84
      ExplorerPatcher/utility.h
  6. 1
      ep_gui/GUI.c
  7. 4
      version.h

46
.github/workflows/build.yml

@ -86,32 +86,32 @@ jobs:
run: | run: |
nuget restore ExplorerPatcher.sln nuget restore ExplorerPatcher.sln
- name: Download ep_taskbar # - name: Download ep_taskbar
uses: robinraju/release-downloader@v1 # uses: robinraju/release-downloader@v1
with: # with:
repository: ExplorerPatcher/ep_taskbar_releases # repository: ExplorerPatcher/ep_taskbar_releases
fileName: ep_taskbar.*.dll # fileName: ep_taskbar.*.dll
latest: true # latest: true
out-file-path: build/Release # out-file-path: build/Release
# build/Release/ep_taskbar.*.amd64.dll -> build/Release/x64/ep_taskbar.*.dll # build/Release/ep_taskbar.*.amd64.dll -> build/Release/x64/ep_taskbar.*.dll
# build/Release/ep_taskbar.*.arm64.dll -> build/Release/ARM64/ep_taskbar.*.dll # build/Release/ep_taskbar.*.arm64.dll -> build/Release/ARM64/ep_taskbar.*.dll
- name: Move ep_taskbar # - name: Move ep_taskbar
shell: bash # shell: bash
run: | # run: |
if ls build/Release/ep_taskbar.*.amd64.dll 1> /dev/null 2>&1; then # if ls build/Release/ep_taskbar.*.amd64.dll 1> /dev/null 2>&1; then
mkdir -p build/Release/x64 # mkdir -p build/Release/x64
for file in build/Release/ep_taskbar.*.amd64.dll; do # for file in build/Release/ep_taskbar.*.amd64.dll; do
mv "$file" "build/Release/x64/$(basename "$file" .amd64.dll).dll" # mv "$file" "build/Release/x64/$(basename "$file" .amd64.dll).dll"
done # done
fi # fi
#
if ls build/Release/ep_taskbar.*.arm64.dll 1> /dev/null 2>&1; then # if ls build/Release/ep_taskbar.*.arm64.dll 1> /dev/null 2>&1; then
mkdir -p build/Release/ARM64 # mkdir -p build/Release/ARM64
for file in build/Release/ep_taskbar.*.arm64.dll; do # for file in build/Release/ep_taskbar.*.arm64.dll; do
mv "$file" "build/Release/ARM64/$(basename "$file" .arm64.dll).dll" # mv "$file" "build/Release/ARM64/$(basename "$file" .arm64.dll).dll"
done # done
fi # fi
- name: Build funchook amd64 - name: Build funchook amd64
shell: powershell shell: powershell

12
CHANGELOG.md

@ -2,17 +2,23 @@
This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub. This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub.
## 22621.3810.66 ## 22621.3880.66
##### 1
Tested on OS builds 19045.4598, 22621.3296, 22621.3810, 26120.961, and 26244.5000. (Note: 22621 and 22631 share the same OS files) Tested on OS builds 19045.4598, 22621.3296, 22621.3810, 26120.961, and 26244.5000. (Note: 22621 and 22631 share the same OS files)
##### 1
* Taskbar10: Introduced a new taskbar implementation: Windows 10 (ExplorerPatcher). (146070d, 0b86e55) * Taskbar10: Introduced a new taskbar implementation: Windows 10 (ExplorerPatcher). (146070d, 0b86e55)
* You can try this implementation out by changing the "Taskbar style" to "Windows 10 (ExplorerPatcher)". * You can try this implementation out by changing the "Taskbar style" to "Windows 10 (ExplorerPatcher)".
* For now, this is **only available for builds 22621, 22631, and 22635.** Other builds will not have the option. * For now, this is **only available for builds 22621, 22631, and 22635.** Other builds will not have the option.
* Refer to [this wiki article](https://github.com/valinet/ExplorerPatcher/wiki/ExplorerPatcher's-taskbar-implementation) for more information including important ones. * Refer to [this wiki article](https://github.com/valinet/ExplorerPatcher/wiki/ExplorerPatcher's-taskbar-implementation) for more information including important ones.
##### 2
* Taskbar10: Due to false positive antivirus detections, the new taskbar implementation is no longer bundled in the setup program. (48c2a75)
* If you want to use the new taskbar implementation, you can download the appropriate DLL for your system from the [Releases](https://github.com/ExplorerPatcher/ep_taskbar_releases/releases/latest) page of its releases repository, and then manually putting it in `C:\Program Files\ExplorerPatcher` without the architecture specifier.
* For example, for 226xx builds on x64-based systems, download `ep_taskbar.2.amd64.dll`, rename to `ep_taskbar.2.dll`, and lastly put it in `C:\Program Files\ExplorerPatcher`.
## 22621.3527.65 ## 22621.3527.65
Tested on OS builds 22621.3296, 22621.3447, 22621.3527, 22635.3566, 26058.1000, 26120.461, and 26200.5001. (Note: 22621 and 22631 share the same OS files) Tested on OS builds 22621.3296, 22621.3447, 22621.3527, 22635.3566, 26058.1000, 26120.461, and 26200.5001. (Note: 22621 and 22631 share the same OS files)

71
ExplorerPatcher/ImmersiveColor.h

@ -2,76 +2,7 @@
#include <Windows.h> #include <Windows.h>
enum IMMERSIVE_COLOR_TYPE #include "utility.h"
{
// Defining only used ones
IMCLR_SystemAccentLight2 = 2,
IMCLR_SystemAccentDark2 = 6
};
struct IMMERSIVE_COLOR_PREFERENCE
{
DWORD crStartColor;
DWORD crAccentColor;
};
enum IMMERSIVE_HC_CACHE_MODE
{
IHCM_USE_CACHED_VALUE = 0,
IHCM_REFRESH = 1
};
typedef bool (*RefreshImmersiveColorPolicyState_t)(); // 104
inline bool RefreshImmersiveColorPolicyState()
{
static RefreshImmersiveColorPolicyState_t fn;
if (!fn)
{
HMODULE h = GetModuleHandleW(L"uxtheme.dll");
if (h)
fn = (RefreshImmersiveColorPolicyState_t)GetProcAddress(h, MAKEINTRESOURCEA(104));
}
return fn ? fn() : false;
}
typedef bool (*GetIsImmersiveColorUsingHighContrast_t)(IMMERSIVE_HC_CACHE_MODE); // 106
inline bool GetIsImmersiveColorUsingHighContrast(IMMERSIVE_HC_CACHE_MODE mode)
{
static GetIsImmersiveColorUsingHighContrast_t fn;
if (!fn)
{
HMODULE h = GetModuleHandleW(L"uxtheme.dll");
if (h)
fn = (GetIsImmersiveColorUsingHighContrast_t)GetProcAddress(h, MAKEINTRESOURCEA(106));
}
return fn ? fn(mode) : false;
}
typedef HRESULT (*GetUserColorPreference_t)(IMMERSIVE_COLOR_PREFERENCE*, bool); // 120
inline HRESULT GetUserColorPreference(IMMERSIVE_COLOR_PREFERENCE* pcpColorPreference, bool fForceReload)
{
static GetUserColorPreference_t fn;
if (!fn)
{
HMODULE h = GetModuleHandleW(L"uxtheme.dll");
if (h)
fn = (GetUserColorPreference_t)GetProcAddress(h, MAKEINTRESOURCEA(120));
}
return fn ? fn(pcpColorPreference, fForceReload) : E_FAIL;
}
typedef DWORD (*GetColorFromPreference_t)(const IMMERSIVE_COLOR_PREFERENCE*, IMMERSIVE_COLOR_TYPE, bool, IMMERSIVE_HC_CACHE_MODE); // 121
inline DWORD GetColorFromPreference(const IMMERSIVE_COLOR_PREFERENCE* cpcpPreference, IMMERSIVE_COLOR_TYPE colorType, bool fNoHighContrast, IMMERSIVE_HC_CACHE_MODE mode)
{
static GetColorFromPreference_t fn;
if (!fn)
{
HMODULE h = GetModuleHandleW(L"uxtheme.dll");
if (h)
fn = (GetColorFromPreference_t)GetProcAddress(h, MAKEINTRESOURCEA(121));
}
return fn ? fn(cpcpPreference, colorType, fNoHighContrast, mode) : 0;
}
class CImmersiveColor class CImmersiveColor
{ {

28
ExplorerPatcher/dllmain.c

@ -2121,10 +2121,12 @@ INT64 ReBarWindow32SubclassProc(_In_ HWND hWnd, _In_ UINT uMsg, _In_ WPARAM wPar
return DefSubclassProc(hWnd, uMsg, wParam, lParam); return DefSubclassProc(hWnd, uMsg, wParam, lParam);
} }
HMODULE g_hMyTaskbar;
HMENU explorer_LoadMenuW(HINSTANCE hInstance, LPCWSTR lpMenuName) HMENU explorer_LoadMenuW(HINSTANCE hInstance, LPCWSTR lpMenuName)
{ {
HMENU hMenu = LoadMenuW(hInstance, lpMenuName); HMENU hMenu = LoadMenuW(hInstance, lpMenuName);
if (hInstance == GetModuleHandle(NULL) && lpMenuName == MAKEINTRESOURCEW(205)) if ((hInstance == GetModuleHandle(NULL) || (g_hMyTaskbar && hInstance == g_hMyTaskbar)) && lpMenuName == MAKEINTRESOURCEW(205))
{ {
HMENU hSubMenu = GetSubMenu(hMenu, 0); HMENU hSubMenu = GetSubMenu(hMenu, 0);
if (hSubMenu) if (hSubMenu)
@ -12210,6 +12212,7 @@ HMODULE PrepareAlternateTaskbarImplementation(symbols_addr* symbols_PTRS, const
wprintf(L"[TB] '%s' not found\n", pszTaskbarDll); wprintf(L"[TB] '%s' not found\n", pszTaskbarDll);
return NULL; return NULL;
} }
g_hMyTaskbar = hMyTaskbar;
typedef DWORD (*GetVersion_t)(); typedef DWORD (*GetVersion_t)();
GetVersion_t GetVersion = (GetVersion_t)GetProcAddress(hMyTaskbar, "GetVersion"); GetVersion_t GetVersion = (GetVersion_t)GetProcAddress(hMyTaskbar, "GetVersion");
@ -12909,15 +12912,19 @@ DWORD Inject(BOOL bIsExplorer)
HANDLE hUxtheme = LoadLibraryW(L"uxtheme.dll"); HANDLE hUxtheme = LoadLibraryW(L"uxtheme.dll");
SetPreferredAppMode = GetProcAddress(hUxtheme, (LPCSTR)0x87); GetThemeName = (GetThemeName_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(74));
AllowDarkModeForWindow = GetProcAddress(hUxtheme, (LPCSTR)0x85); RefreshImmersiveColorPolicyState = (RefreshImmersiveColorPolicyState_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(104));
ShouldAppsUseDarkMode = GetProcAddress(hUxtheme, (LPCSTR)0x84); GetIsImmersiveColorUsingHighContrast = (GetIsImmersiveColorUsingHighContrast_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(106));
ShouldSystemUseDarkMode = GetProcAddress(hUxtheme, (LPCSTR)0x8A); GetUserColorPreference = (GetUserColorPreference_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(120));
GetThemeName = GetProcAddress(hUxtheme, (LPCSTR)0x4A); GetColorFromPreference = (GetColorFromPreference_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(121));
PeopleBand_DrawTextWithGlowFunc = GetProcAddress(hUxtheme, (LPCSTR)0x7E); PeopleBand_DrawTextWithGlowFunc = GetProcAddress(hUxtheme, MAKEINTRESOURCEA(126));
ShouldAppsUseDarkMode = (ShouldAppsUseDarkMode_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(132));
AllowDarkModeForWindow = (AllowDarkModeForWindow_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(133));
SetPreferredAppMode = (SetPreferredAppMode_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(135));
ShouldSystemUseDarkMode = (ShouldSystemUseDarkMode_t)GetProcAddress(hUxtheme, MAKEINTRESOURCEA(138));
if (bOldTaskbar) if (bOldTaskbar)
{ {
VnPatchIAT(hExplorer, "uxtheme.dll", (LPCSTR)0x7E, PeopleBand_DrawTextWithGlowHook); VnPatchIAT(hExplorer, "uxtheme.dll", MAKEINTRESOURCEA(126), PeopleBand_DrawTextWithGlowHook);
} }
// DwmExtendFrameIntoClientArea hooked in LoadSettings // DwmExtendFrameIntoClientArea hooked in LoadSettings
printf("Setup uxtheme functions done\n"); printf("Setup uxtheme functions done\n");
@ -13117,6 +13124,11 @@ DWORD Inject(BOOL bIsExplorer)
VnPatchIAT(hTwinuiPcshell, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegGetValueW", twinuipcshell_RegGetValueW); VnPatchIAT(hTwinuiPcshell, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegGetValueW", twinuipcshell_RegGetValueW);
HMODULE hMyTaskbar = PrepareAlternateTaskbarImplementation(&symbols_PTRS, pszTaskbarDll); HMODULE hMyTaskbar = PrepareAlternateTaskbarImplementation(&symbols_PTRS, pszTaskbarDll);
if (hMyTaskbar)
{
VnPatchIAT(hMyTaskbar, "user32.dll", "LoadMenuW", explorer_LoadMenuW);
VnPatchIAT(hMyTaskbar, "user32.dll", "TrackPopupMenuEx", explorer_TrackPopupMenuExHook);
}
printf("Setup twinui.pcshell functions done\n"); printf("Setup twinui.pcshell functions done\n");

84
ExplorerPatcher/utility.h

@ -32,6 +32,12 @@
#define WM_MSG_GUI_SECTION WM_USER + 1 #define WM_MSG_GUI_SECTION WM_USER + 1
#define WM_MSG_GUI_SECTION_GET 1 #define WM_MSG_GUI_SECTION_GET 1
#ifdef __cplusplus
#define EP_INLINE inline
#else
#define EP_INLINE
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -98,10 +104,7 @@ DEFINE_GUID(IID_ITrayUIComponent,
0x64, 0xb4, 0xc0, 0x9b, 0x21, 0x1b 0x64, 0xb4, 0xc0, 0x9b, 0x21, 0x1b
); );
#ifdef __cplusplus EP_INLINE HRESULT(*explorer_TrayUI_CreateInstanceFunc)(ITrayUIHost* host, REFIID riid, void** ppv);
inline
#endif
HRESULT(*explorer_TrayUI_CreateInstanceFunc)(ITrayUIHost* host, REFIID riid, void** ppv);
#pragma endregion #pragma endregion
inline int FileExistsW(wchar_t* file) inline int FileExistsW(wchar_t* file)
@ -144,10 +147,7 @@ typedef LSTATUS(*t_SHRegGetValueFromHKCUHKLM)(
void* pvData, void* pvData,
DWORD* pcbData DWORD* pcbData
); );
#ifdef __cplusplus EP_INLINE t_SHRegGetValueFromHKCUHKLM SHRegGetValueFromHKCUHKLMFunc;
inline
#endif
t_SHRegGetValueFromHKCUHKLM SHRegGetValueFromHKCUHKLMFunc;
inline LSTATUS SHRegGetValueFromHKCUHKLMWithOpt( inline LSTATUS SHRegGetValueFromHKCUHKLMWithOpt(
PCWSTR pwszKey, PCWSTR pwszKey,
@ -217,10 +217,7 @@ inline LSTATUS SHRegGetValueFromHKCUHKLMWithOpt(
return lRes; return lRes;
} }
#ifdef __cplusplus EP_INLINE HWND(WINAPI* CreateWindowInBand)(
inline
#endif
HWND(WINAPI* CreateWindowInBand)(
_In_ DWORD dwExStyle, _In_ DWORD dwExStyle,
_In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpClassName,
_In_opt_ LPCWSTR lpWindowName, _In_opt_ LPCWSTR lpWindowName,
@ -236,30 +233,59 @@ HWND(WINAPI* CreateWindowInBand)(
DWORD band DWORD band
); );
#ifdef __cplusplus EP_INLINE BOOL(WINAPI* GetWindowBand)(HWND hWnd, PDWORD pdwBand);
inline
#endif
BOOL(WINAPI* GetWindowBand)(HWND hWnd, PDWORD pdwBand);
#ifdef __cplusplus EP_INLINE BOOL(WINAPI* SetWindowBand)(HWND hWnd, HWND hwndInsertAfter, DWORD dwBand);
inline
#endif
BOOL(WINAPI* SetWindowBand)(HWND hWnd, HWND hwndInsertAfter, DWORD dwBand);
#ifdef __cplusplus EP_INLINE INT64(*SetWindowCompositionAttribute)(HWND, void*);
inline
#endif // uxtheme.dll private functions
INT64(*SetWindowCompositionAttribute)(HWND, void*);
typedef enum IMMERSIVE_COLOR_TYPE
{
// Defining only used ones
IMCLR_SystemAccentLight2 = 2,
IMCLR_SystemAccentDark2 = 6
} IMMERSIVE_COLOR_TYPE;
typedef struct IMMERSIVE_COLOR_PREFERENCE
{
DWORD crStartColor;
DWORD crAccentColor;
} IMMERSIVE_COLOR_PREFERENCE;
typedef enum IMMERSIVE_HC_CACHE_MODE
{
IHCM_USE_CACHED_VALUE = 0,
IHCM_REFRESH = 1
} IMMERSIVE_HC_CACHE_MODE;
typedef void(*GetThemeName_t)(void*, void*, void*); // 74
EP_INLINE GetThemeName_t GetThemeName;
typedef bool(*RefreshImmersiveColorPolicyState_t)(); // 104
EP_INLINE RefreshImmersiveColorPolicyState_t RefreshImmersiveColorPolicyState;
typedef bool(*GetIsImmersiveColorUsingHighContrast_t)(IMMERSIVE_HC_CACHE_MODE); // 106
EP_INLINE GetIsImmersiveColorUsingHighContrast_t GetIsImmersiveColorUsingHighContrast;
typedef HRESULT(*GetUserColorPreference_t)(IMMERSIVE_COLOR_PREFERENCE*, bool); // 120
EP_INLINE GetUserColorPreference_t GetUserColorPreference;
static void(*SetPreferredAppMode)(BOOL bAllowDark); typedef DWORD(*GetColorFromPreference_t)(const IMMERSIVE_COLOR_PREFERENCE*, IMMERSIVE_COLOR_TYPE, bool, IMMERSIVE_HC_CACHE_MODE); // 121
EP_INLINE GetColorFromPreference_t GetColorFromPreference;
static void(*AllowDarkModeForWindow)(HWND hWnd, BOOL bAllowDark); typedef bool(*ShouldAppsUseDarkMode_t)(); // 132
EP_INLINE ShouldAppsUseDarkMode_t ShouldAppsUseDarkMode;
static bool(*ShouldAppsUseDarkMode)(); typedef void(*AllowDarkModeForWindow_t)(HWND hWnd, BOOL bAllowDark); // 133
EP_INLINE AllowDarkModeForWindow_t AllowDarkModeForWindow;
static bool(*ShouldSystemUseDarkMode)(); typedef void(*SetPreferredAppMode_t)(BOOL bAllowDark); // 135
EP_INLINE SetPreferredAppMode_t SetPreferredAppMode;
static void(*GetThemeName)(void*, void*, void*); typedef bool(*ShouldSystemUseDarkMode_t)(); // 138
EP_INLINE ShouldSystemUseDarkMode_t ShouldSystemUseDarkMode;
void* ReadFromFile(wchar_t* wszFileName, DWORD* dwSize); void* ReadFromFile(wchar_t* wszFileName, DWORD* dwSize);

1
ep_gui/GUI.c

@ -10,7 +10,6 @@ WCHAR wszThreadLanguage[LOCALE_NAME_MAX_LENGTH];
void* GUI_FileMapping = NULL; void* GUI_FileMapping = NULL;
DWORD GUI_FileSize = 0; DWORD GUI_FileSize = 0;
BOOL g_darkModeEnabled = FALSE; BOOL g_darkModeEnabled = FALSE;
static void(*RefreshImmersiveColorPolicyState)() = NULL;
DWORD dwTaskbarPosition = 3; DWORD dwTaskbarPosition = 3;
DWORD GUI_TaskbarStyle = 1; DWORD GUI_TaskbarStyle = 1;

4
version.h

@ -1,7 +1,7 @@
#define VER_MAJOR 22621 #define VER_MAJOR 22621
#define VER_MINOR 3810 #define VER_MINOR 3880
#define VER_BUILD_HI 66 #define VER_BUILD_HI 66
#define VER_BUILD_LO 1 #define VER_BUILD_LO 2
#define VER_FLAGS VS_FF_PRERELEASE #define VER_FLAGS VS_FF_PRERELEASE

Loading…
Cancel
Save