Skip to content

Commit bf07fad

Browse files
committed
Updated to v31
1 parent 87f5ea4 commit bf07fad

17 files changed

+2838
-761
lines changed

CHANGELOG.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,41 @@
22

33
This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub.
44

5-
## 22000.258.30.3
5+
## 22000.258.31.0
6+
7+
Tested on build: 22000.258.
8+
9+
#### New features
10+
11+
* Cortana button now opens the Widgets panel
12+
* Ability to choose what happens when clicking the Network icon in the system tray
13+
* Possibility to use the legacy clock flyout
14+
* Possibility to use the legacy volume flyout
15+
* Fixes to fully support the classic theme, with a functional taskbar, system tray, Explorer windows, working context menus; read more about this feature [here](https://github.com/valinet/ExplorerPatcher/discussions/101)
16+
17+
#### Feature enhancements
18+
19+
* Reorganized settings in the GUI
20+
* Added option not to have an accelerator for the `Properties` menu entry in `Win`+`X` (#162)
21+
22+
#### Fixes
23+
24+
* Fixed an issue where the Windows 10 window switcher failed to display some windows (#161)
25+
* Fixed an issue that prevented Start from opening again until Explorer was restarted after opening File Explorer via the Start menu Explorer icon (#145)
26+
* Fixed patching in libvalinet
27+
* Fixed GUI launch path; GUI now launches in an external process, survives Explorer restarts
28+
29+
#### Experimental
30+
31+
The application can now be registered as a shell extension. This will enable the Explorer related functionality to work in Open/Save file dialogs as well. This is especially useful for users wanting proper support of the classic theme in Windows 11.
32+
33+
Please note that this is experimental. For the moment, the preferred installation method remains dropping the DLL in `C:\Windows`. For interested users, I invite you to test this functionality and report your findings in the discussions board.
34+
35+
To enable this, put the 2 DLLs (`ExplorerPatcher.amd64.dll` and `ExplorerPatcher.IA-32.dll`) in a secure folder (for example, `C:\Program Files\ExplorerPatcher`). Then, in that folder, run this command: `regsvr32 ExplorerPatcher.amd64.dll`. After elevation, a message will display informing you of the operation outcome, and if it went well, Explorer will restart displaying the old taskbar.
36+
37+
To uninstall, run `regsvr32 /u ExplorerPatcher.amd64.dll` in the same folder and preferably reboot the computer to unload the DLLs from all applications. Then, the files can be deleted just fine.
38+
39+
## 22000.258.30.6
640

741
Tested on build: 22000.258.
842

ExplorerPatcher/ExplorerPatcher.rc

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ END
5151
//
5252

5353
VS_VERSION_INFO VERSIONINFO
54-
FILEVERSION 22000,258,30,6
55-
PRODUCTVERSION 22000,258,30,6
54+
FILEVERSION 22000,258,31,0
55+
PRODUCTVERSION 22000,258,31,0
5656
FILEFLAGSMASK 0x3fL
5757
#ifdef _DEBUG
5858
FILEFLAGS 0x1L
@@ -69,12 +69,12 @@ BEGIN
6969
BEGIN
7070
VALUE "CompanyName", "VALINET Solutions SRL"
7171
VALUE "FileDescription", "ExplorerPatcher"
72-
VALUE "FileVersion", "22000.258.30.6"
72+
VALUE "FileVersion", "22000.258.31.0"
7373
VALUE "InternalName", "ExplorerPatcher.dll"
7474
VALUE "LegalCopyright", "Copyright (C) 2006-2021 VALINET Solutions SRL. All rights reserved."
7575
VALUE "OriginalFilename", "ExplorerPatcher.dll"
7676
VALUE "ProductName", "ExplorerPatcher"
77-
VALUE "ProductVersion", "22000.258.30.6"
77+
VALUE "ProductVersion", "22000.258.31.0"
7878
END
7979
END
8080
BLOCK "VarFileInfo"
@@ -106,6 +106,15 @@ BEGIN
106106
IDS_VISITGITHUB "Visit project Github"
107107
IDS_VISITWEBSITE "Visit web site"
108108
IDS_LICENSEINFO "E-mail author"
109+
IDS_INSTALL_SUCCESS_TEXT "Installation succeeded."
110+
IDS_INSTALL_ERROR_TEXT "Installation failed."
111+
IDS_UNINSTALL_SUCCESS_TEXT "Uninstallation succeeded."
112+
END
113+
114+
STRINGTABLE
115+
BEGIN
116+
IDS_UNINSTALL_ERROR_TEXT "Uninstallation failed."
117+
IDS_OPERATION_NONE "No action has been taken."
109118
END
110119

111120
#endif // English (United States) resources

ExplorerPatcher/GUI.c

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ void* GUI_FileMapping = NULL;
44
DWORD GUI_FileSize = 0;
55
BOOL g_darkModeEnabled = FALSE;
66
static void(*RefreshImmersiveColorPolicyState)() = NULL;
7-
static int(*SetPreferredAppMode)(int bAllowDark) = NULL;
8-
static BOOL(*AllowDarkModeForWindow)(HWND hWnd, BOOL bAllowDark) = NULL;
97
static BOOL(*ShouldAppsUseDarkMode)() = NULL;
108
BOOL IsHighContrast()
119
{
@@ -21,7 +19,6 @@ BOOL IsColorSchemeChangeMessage(LPARAM lParam)
2119
BOOL is = FALSE;
2220
if (lParam && CompareStringOrdinal(lParam, -1, L"ImmersiveColorSet", -1, TRUE) == CSTR_EQUAL)
2321
{
24-
RefreshImmersiveColorPolicyState();
2522
is = TRUE;
2623
}
2724
return is;
@@ -143,7 +140,8 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
143140
logFont.lfHeight = GUI_CAPTION_FONT_SIZE * dy;
144141
logFont.lfWeight = FW_BOLD;
145142
HFONT hFontCaption = CreateFontIndirect(&logFont);
146-
logFont.lfHeight = GUI_TITLE_FONT_SIZE * dy;
143+
logFont = ncm.lfMenuFont;
144+
if (IsThemeActive()) logFont.lfHeight = GUI_TITLE_FONT_SIZE * dy;
147145
HFONT hFontTitle = CreateFontIndirect(&logFont);
148146
logFont.lfWeight = FW_REGULAR;
149147
logFont.lfUnderline = 1;
@@ -152,7 +150,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
152150
logFont.lfUnderline = 0;
153151
HFONT hFontRegular = CreateFontIndirect(&logFont);
154152
logFont.lfWeight = FW_DEMIBOLD;
155-
logFont.lfHeight = GUI_SECTION_FONT_SIZE * dy;
153+
if (IsThemeActive()) logFont.lfHeight = GUI_SECTION_FONT_SIZE * dy;
156154
HFONT hFontSection = CreateFontIndirect(&logFont);
157155
logFont.lfUnderline = 1;
158156
HFONT hFontSectionSel = CreateFontIndirect(&logFont);
@@ -184,10 +182,11 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
184182

185183
if (!IsThemeActive() && hDC)
186184
{
187-
COLORREF oldcr = SetBkColor(hdcPaint, GetSysColor(COLOR_WINDOW));
185+
COLORREF oldcr = SetBkColor(hdcPaint, GetSysColor(COLOR_MENU));
188186
ExtTextOutW(hdcPaint, 0, 0, ETO_OPAQUE, &rc, L"", 0, 0);
189187
SetBkColor(hdcPaint, oldcr);
190188
SetTextColor(hdcPaint, GetSysColor(COLOR_WINDOWTEXT));
189+
SetBkMode(hdcPaint, TRANSPARENT);
191190
}
192191

193192
FILE* f = fmemopen(pRscr, cbRscr, "r");
@@ -433,7 +432,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt)
433432
bTabOrderHit = TRUE;
434433
if (!IsThemeActive())
435434
{
436-
cr = SetTextColor(hdcPaint, GetSysColor(COLOR_HIGHLIGHT));
435+
cr = SetTextColor(hdcPaint, GetSysColor(COLOR_HIGHLIGHTTEXT));
437436
}
438437
else
439438
{
@@ -1255,6 +1254,7 @@ static LRESULT CALLBACK GUI_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR
12551254
{
12561255
if (IsThemeActive() && ShouldAppsUseDarkMode)
12571256
{
1257+
RefreshImmersiveColorPolicyState();
12581258
BOOL bIsCompositionEnabled = TRUE;
12591259
DwmIsCompositionEnabled(&bIsCompositionEnabled);
12601260
BOOL bDarkModeEnabled = IsThemeActive() && bIsCompositionEnabled && ShouldAppsUseDarkMode() && !IsHighContrast();
@@ -1486,14 +1486,14 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
14861486
wszPath,
14871487
(MAX_PATH) * sizeof(wchar_t)
14881488
);
1489-
GetWindowsDirectoryW(
1489+
GetSystemDirectoryW(
14901490
wszPath,
14911491
MAX_PATH
14921492
);
14931493
wcscat_s(
14941494
wszPath,
14951495
MAX_PATH,
1496-
L"\\explorer.exe"
1496+
L"\\shell32.dll"
14971497
);
14981498

14991499
WNDCLASS wc = { 0 };
@@ -1504,18 +1504,32 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
15041504
wc.hInstance = hModule;
15051505
wc.lpszClassName = L"ExplorerPatcherGUI";
15061506
wc.hCursor = LoadCursorW(NULL, IDC_ARROW);
1507-
HMODULE hExplorer = LoadLibraryExW(wszPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
1508-
if (hExplorer)
1507+
HMODULE hShell32 = LoadLibraryExW(wszPath, NULL, LOAD_LIBRARY_AS_DATAFILE);
1508+
if (hShell32)
15091509
{
1510-
_this.hIcon = LoadIconW(hExplorer, L"ICO_MYCOMPUTER");
1510+
_this.hIcon = LoadIconW(hShell32, MAKEINTRESOURCEW(40));
15111511
wc.hIcon = _this.hIcon;
15121512
}
15131513
RegisterClassW(&wc);
15141514

15151515
TCHAR title[260];
15161516
HMODULE hExplorerFrame = LoadLibraryExW(L"ExplorerFrame.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
1517-
LoadStringW(hExplorerFrame, 726, title, 260);
1517+
LoadStringW(hExplorerFrame, 50222, title, 260); // 726 = File Explorer
15181518
FreeLibrary(hExplorerFrame);
1519+
wchar_t* p = wcschr(title, L'(');
1520+
if (p)
1521+
{
1522+
p--;
1523+
if (p == L' ')
1524+
{
1525+
*p = 0;
1526+
}
1527+
else
1528+
{
1529+
p++;
1530+
*p = 0;
1531+
}
1532+
}
15191533
if (title[0] == 0)
15201534
{
15211535
LoadStringW(hModule, IDS_PRODUCTNAME, title, 260);
@@ -1587,10 +1601,10 @@ __declspec(dllexport) int ZZGUI(HWND hWnd, HINSTANCE hInstance, LPSTR lpszCmdLin
15871601
DispatchMessage(&msg);
15881602
}
15891603

1590-
if (hExplorer)
1604+
if (hShell32)
15911605
{
15921606
CloseHandle(_this.hIcon);
1593-
FreeLibrary(hExplorer);
1607+
FreeLibrary(hShell32);
15941608
}
15951609

15961610
if (bHasLoadedUxtheme && hUxtheme)

ExplorerPatcher/HideExplorerSearchBar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ VOID HideExplorerSearchBar(HWND hWnd)
9494
);
9595
}
9696

97-
LRESULT HideExplorerSearchBarSubClass(
97+
LRESULT CALLBACK HideExplorerSearchBarSubClass(
9898
HWND hWnd,
9999
UINT uMsg,
100100
WPARAM wParam,

ExplorerPatcher/HideExplorerSearchBar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ HWND FindChildWindow(
1313
// https://github.com/Open-Shell/Open-Shell-Menu/blob/master/Src/ClassicExplorer/ExplorerBHO.cpp
1414
VOID HideExplorerSearchBar(HWND hWnd);
1515

16-
LRESULT HideExplorerSearchBarSubClass(
16+
LRESULT CALLBACK HideExplorerSearchBarSubClass(
1717
HWND hWnd,
1818
UINT uMsg,
1919
WPARAM wParam,

ExplorerPatcher/SettingsMonitor.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
#include "SettingsMonitor.h"
22

3-
DWORD MonitorSettings(SettingsChangeParameters* params)
3+
DWORD WINAPI MonitorSettings(SettingsChangeParameters* params)
44
{
5+
BOOL bShouldExit = FALSE;
6+
57
while (TRUE)
68
{
7-
HANDLE* handles = malloc(sizeof(HANDLE) * params->size);
9+
HANDLE* handles = malloc(sizeof(HANDLE) * (params->size + 1));
810
if (!handles)
911
{
1012
return 0;
@@ -42,23 +44,35 @@ DWORD MonitorSettings(SettingsChangeParameters* params)
4244
return 0;
4345
}
4446
}
47+
handles[params->size] = params->hExitEvent;
4548
DWORD dwRes = WaitForMultipleObjects(
46-
params->size,
49+
params->size + (params->hExitEvent ? 1 : 0),
4750
handles,
4851
FALSE,
4952
INFINITE
5053
);
5154
if (dwRes != WAIT_FAILED)
5255
{
5356
unsigned int i = dwRes - WAIT_OBJECT_0;
54-
params->settings[i].callback(params->settings[i].data);
57+
if (i >= 0 && i < params->size)
58+
{
59+
params->settings[i].callback(params->settings[i].data);
60+
}
61+
else if (i == params->size)
62+
{
63+
bShouldExit = TRUE;
64+
}
5565
}
5666
free(handles);
5767
for (unsigned int i = 0; i < params->size; ++i)
5868
{
5969
CloseHandle(params->settings[i].hEvent);
6070
RegCloseKey(params->settings[i].hKey);
6171
}
72+
if (bShouldExit)
73+
{
74+
break;
75+
}
6276
}
6377
}
6478

ExplorerPatcher/SettingsMonitor.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@ typedef struct _Setting
1010
wchar_t name[MAX_PATH];
1111
HKEY hKey;
1212
HANDLE hEvent;
13-
void(*callback)(void*);
13+
void(__stdcall *callback)(void*);
1414
void* data;
1515
} Setting;
1616
typedef struct _SettingsChangeParameters
1717
{
1818
Setting* settings;
1919
DWORD size;
20+
HANDLE hExitEvent;
2021
} SettingsChangeParameters;
21-
DWORD MonitorSettings(SettingsChangeParameters*);
22+
DWORD WINAPI MonitorSettings(SettingsChangeParameters*);
2223
#endif

0 commit comments

Comments
 (0)