Skip to content
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.

Commit

Permalink
Merge branch 'valinet:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
creeper-0910 authored Oct 12, 2022
2 parents 9399c7f + f285371 commit fde380e
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Please make sure you are connected to the Internet while installing, the applica
* Fixed the Windows 10 network and battery flyouts on OS build 22621.
* Weather: Fixed a bug that displayed the widget contents with incorrect left padding.

##### 2

* sws: Support for changing selection in window list using the mouse wheel (suggestion by andrewz).
* Fix broken "Cascade windows", "Show windows stacked", "Show windows side by side", and "Undo ..." options in taskbar context menu (reported by iamk9008).

## 22622.450.50

OSビルド22622.450でテストしています。
Expand Down
68 changes: 55 additions & 13 deletions ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2487,7 +2487,34 @@ INT64 Shell_TrayWndSubclassProc(
}
DeleteMenu(hSubMenu, 424, MF_BYCOMMAND); // Lock the taskbar
DeleteMenu(hSubMenu, 425, MF_BYCOMMAND); // Lock all taskbars
DeleteMenu(hSubMenu, 416, MF_BYCOMMAND); // Undo
HWND hShellTray_Wnd = FindWindowExW(NULL, NULL, L"Shell_TrayWnd", NULL);
INT64* CTrayInstance = (BYTE*)(GetWindowLongPtrW(hShellTray_Wnd, 0)); // -> CTray
const unsigned int TRAYUI_OFFSET_IN_CTRAY = 110;
uintptr_t TrayUIInstance = *((INT64*)CTrayInstance + TRAYUI_OFFSET_IN_CTRAY) + 8;
if (TrayUIInstance)
{
int offset = 656;
if (IsWindows11Version22H2OrHigher()) offset = 640;
if ((*(unsigned __int8(__fastcall**)(INT64))(**(INT64**)(TrayUIInstance + offset) + 104i64))(*(INT64*)(TrayUIInstance + offset)))
{
DeleteMenu(hSubMenu, 0x1A0u, 0);
}
else
{
WCHAR Buffer[MAX_PATH];
WCHAR v40[MAX_PATH];
WCHAR NewItem[MAX_PATH];
LoadStringW(GetModuleHandleW(NULL), 0x216u, Buffer, 64);
UINT v22 = (*(__int64(__fastcall**)(INT64))(**(INT64**)(TrayUIInstance + offset) + 112i64))(*(INT64*)(TrayUIInstance + offset));
LoadStringW(GetModuleHandleW(NULL), v22, v40, 96);
swprintf_s(NewItem, 0xA0ui64, Buffer, v40);
ModifyMenuW(hSubMenu, 0x1A0u, 0, 0x1A0ui64, NewItem);
}
}
else
{
DeleteMenu(hSubMenu, 416, MF_BYCOMMAND); // Undo
}
DeleteMenu(hSubMenu, 437, MF_BYCOMMAND); // Show Pen button
DeleteMenu(hSubMenu, 438, MF_BYCOMMAND); // Show touchpad button
DeleteMenu(hSubMenu, 435, MF_BYCOMMAND); // Show People on the taskbar
Expand Down Expand Up @@ -2570,18 +2597,6 @@ INT64 Shell_TrayWndSubclassProc(
{
LaunchPropertiesGUI(hModule);
}
else if (res == 403)
{
CascadeWindows(NULL, 0, NULL, 0, NULL);
}
else if (res == 404)
{
TileWindows(NULL, 0, NULL, 0, NULL);
}
else if (res == 405)
{
TileWindows(NULL, 1, NULL, 0, NULL);
}
else
{
PostMessageW(hWnd, WM_COMMAND, res, 0);
Expand Down Expand Up @@ -9509,6 +9524,31 @@ int explorerframe_GetSystemMetricsForDpi(int nIndex, UINT dpi)
#pragma endregion


#pragma region "Fix taskbar cascade and tile windows options not working"
WORD explorer_TileWindows(
HWND hwndParent,
UINT wHow,
const RECT* lpRect,
UINT cKids,
const HWND* lpKids
)
{
return TileWindows((hwndParent == GetShellWindow()) ? GetDesktopWindow() : hwndParent, wHow, lpRect, cKids, lpKids);
}

WORD explorer_CascadeWindows(
HWND hwndParent,
UINT wHow,
const RECT* lpRect,
UINT cKids,
const HWND* lpKids
)
{
return CascadeWindows((hwndParent == GetShellWindow()) ? GetDesktopWindow() : hwndParent, wHow, lpRect, cKids, lpKids);
}
#pragma endregion


DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
{
//Sleep(150);
Expand Down Expand Up @@ -10080,6 +10120,8 @@ DWORD Inject(BOOL bIsExplorer)
if (IsOS(OS_ANYSERVER)) VnPatchIAT(hExplorer, "api-ms-win-shcore-sysinfo-l1-1-0.dll", "IsOS", explorer_IsOS);
if (IsWindows11Version22H2OrHigher()) VnPatchDelayIAT(hExplorer, "ext-ms-win-rtcore-ntuser-window-ext-l1-1-0.dll", "CreateWindowExW", Windows11v22H2_explorer_CreateWindowExW);
}
VnPatchIAT(hExplorer, "user32.dll", "TileWindows", explorer_TileWindows);
VnPatchIAT(hExplorer, "user32.dll", "CascadeWindows", explorer_CascadeWindows);
VnPatchIAT(hExplorer, "API-MS-WIN-CORE-REGISTRY-L1-1-0.DLL", "RegOpenKeyExW", explorer_RegOpenKeyExW);
VnPatchIAT(hExplorer, "shell32.dll", (LPCSTR)85, explorer_OpenRegStream);
VnPatchIAT(hExplorer, "user32.dll", "TrackPopupMenuEx", explorer_TrackPopupMenuExHook);
Expand Down
2 changes: 1 addition & 1 deletion libs/sws
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define VER_MAJOR 22621
#define VER_MINOR 608
#define VER_BUILD_HI 51
#define VER_BUILD_LO 1
#define VER_BUILD_LO 2
#define VER_FLAGS VS_FF_PRERELEASE


Expand All @@ -12,5 +12,5 @@
#define VER_STR(arg) #arg

// The String form of the version numbers
#define VER_FILE_STRING VALUE "FileVersion", "22621.608.51.1"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.608.51.1"
#define VER_FILE_STRING VALUE "FileVersion", "22621.608.51.2"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.608.51.2"

0 comments on commit fde380e

Please sign in to comment.