@@ -13519,6 +13519,43 @@ static BOOL StartMenu_FixContextMenuXbfHijackMethod()
13519
13519
return TRUE;
13520
13520
}
13521
13521
13522
+ // void StartUI::UserTileView::AppendMenuFlyoutItemCommand(class Windows::UI::Xaml::Controls::MenuFlyout^, class Windows::Internal::Shell::StartUI::UserTileCommand^, enum Windows::Internal::Shell::StartUI::UserTileCommandId)
13523
+ void (* StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc )(void * _this , void * menuFlyout , void * userTileCommand , int id );
13524
+ void StartUI_UserTileView_AppendMenuFlyoutItemCommandHook (void * _this , void * menuFlyout , void * userTileCommand , int id )
13525
+ {
13526
+ // 4 = UserTile_LaunchAccountBadging
13527
+ // 5 = UserTile_AccountBadgingSecondary
13528
+ if (id == 4 || id == 5 )
13529
+ {
13530
+ return ;
13531
+ }
13532
+ StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc (_this , menuFlyout , userTileCommand , id );
13533
+ }
13534
+
13535
+ static void StartMenu_FixUserTileMenu (MODULEINFO * mi )
13536
+ {
13537
+ // 41 B9 03 00 00 00 4D 8B C4 ?? 8B D6 49 8B CD E8 ?? ?? ?? ??
13538
+ // ^^^^^^^^^^^
13539
+ // Ref: <lambda_3a9b433356e31b02e54fffbca0ecf3fa>::operator()
13540
+ PBYTE match = FindPattern (
13541
+ mi -> lpBaseOfDll ,
13542
+ mi -> SizeOfImage ,
13543
+ "\x41\xB9\x03\x00\x00\x00\x4D\x8B\xC4\x00\x8B\xD6\x49\x8B\xCD\xE8" ,
13544
+ "xxxxxxxxx?xxxxxx"
13545
+ );
13546
+ if (match )
13547
+ {
13548
+ match += 15 ;
13549
+ match += 5 + * (int * )(match + 1 );
13550
+ StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc = match ;
13551
+ funchook_prepare (
13552
+ funchook ,
13553
+ (void * * )& StartUI_UserTileView_AppendMenuFlyoutItemCommandFunc ,
13554
+ StartUI_UserTileView_AppendMenuFlyoutItemCommandHook
13555
+ );
13556
+ }
13557
+ }
13558
+
13522
13559
LSTATUS StartUI_RegOpenKeyExW (HKEY hKey , LPCWSTR lpSubKey , DWORD ulOptions , REGSAM samDesired , PHKEY phkResult )
13523
13560
{
13524
13561
if (wcsstr (lpSubKey , L"$start.tilegrid$windows.data.curatedtilecollection.tilecollection\\Current" ))
@@ -14159,13 +14196,19 @@ DWORD InjectStartMenu()
14159
14196
14160
14197
if (IsWindows11 ())
14161
14198
{
14199
+ MODULEINFO miStartUI ;
14200
+ GetModuleInformation (GetCurrentProcess (), hStartUI , & miStartUI , sizeof (miStartUI ));
14201
+
14162
14202
// Fixes Pin to Start/Unpin from Start
14163
14203
PatchAppResolver ();
14164
14204
PatchStartTileData (TRUE);
14165
14205
14166
14206
// Fixes context menu crashes
14167
14207
StartMenu_FixContextMenuXbfHijackMethod ();
14168
14208
14209
+ // Fixes user tile menu
14210
+ StartMenu_FixUserTileMenu (& miStartUI );
14211
+
14169
14212
// Enables "Show more tiles" setting
14170
14213
LoadLibraryW (L"Windows.CloudStore.dll" );
14171
14214
HANDLE hWindowsCloudStore = GetModuleHandleW (L"Windows.CloudStore.dll" );
0 commit comments