Skip to content

Commit

Permalink
Ability to choose Snap Assist style
Browse files Browse the repository at this point in the history
  • Loading branch information
valinet committed Dec 14, 2021
1 parent dfd7030 commit 94db02b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ Tested on build 22000.348.
* Mitigation for the issue described in #416 (.7)
* Fixed a bug that prevented the Windows 10 window switcher from displaying when it was enabled, instead falling back to the Windows NT window switcher (#548) (.8)
* Fixed the "Show People in the taskbar" option and made it not require a restart to apply (#554) (.10)
* Ability to choose look of Snap Assist (window list when snapping a window): Windows 11 or Windows 11 style (.11)
* Fixed a bug that prevented the correct set up of "DisplayVersion" registry entry in the uninstall information registry key (.11)

#### Simple Window Switcher

Expand Down
19 changes: 18 additions & 1 deletion ExplorerPatcher/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ DWORD bTaskbarAutohideOnDoubleClick = FALSE;
DWORD dwOrbStyle = 0;
DWORD bEnableSymbolDownload = TRUE;
DWORD dwAltTabSettings = 0;
DWORD dwSnapAssistSettings = 0;
HMODULE hModule = NULL;
HANDLE hDelayedInjectionThread = NULL;
HANDLE hIsWinXShown = NULL;
Expand Down Expand Up @@ -3884,6 +3885,15 @@ void WINAPI LoadSettings(BOOL bIsExplorer)
LaunchPropertiesGUI(hModule);
#endif
}
dwSize = sizeof(DWORD);
RegQueryValueExW(
hKey,
TEXT("SnapAssistSettings"),
0,
NULL,
&dwSnapAssistSettings,
&dwSize
);
RegCloseKey(hKey);
}

Expand Down Expand Up @@ -5325,10 +5335,17 @@ DWORD InjectBasicFunctions(BOOL bIsExplorer, BOOL bInstall)
INT64(*twinui_pcshell_IsUndockedAssetAvailableFunc)(INT a1, INT64 a2, INT64 a3, const char* a4);
INT64 twinui_pcshell_IsUndockedAssetAvailableHook(INT a1, INT64 a2, INT64 a3, const char* a4)
{
if (dwAltTabSettings == 3 || dwAltTabSettings == 2)
// if IsAltTab and AltTabSettings == Windows 10 or sws (Precision Touchpad gesture)
if (a1 == 1 && (dwAltTabSettings == 3 || dwAltTabSettings == 2))
{
return 0;
}
// if IsSnapAssist and SnapAssistSettings == Windows 10
else if (a1 == 4 && dwSnapAssistSettings == 3)
{
return 0;
}
// else, show Windows 11 style basically
else
{
return twinui_pcshell_IsUndockedAssetAvailableFunc(a1, a2, a3, a4);
Expand Down
5 changes: 5 additions & 0 deletions ExplorerPatcher/settings.reg
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,11 @@
;x 2 Shut down (default)
;x 4 Restart
"Start_PowerButtonAction"=dword:00000002
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher]
;c 2 Snap Assist style
;x 0 Windows 11 (default)
;x 3 Windows 10
"SnapAssistSettings"=dword:00000000


;T Updates
Expand Down
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 22000
#define VER_MINOR 348
#define VER_BUILD_HI 40
#define VER_BUILD_LO 10
#define VER_BUILD_LO 11
#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", "22000.348.40.10"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.348.40.10"
#define VER_FILE_STRING VALUE "FileVersion", "22000.348.40.11"
#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.348.40.11"

0 comments on commit 94db02b

Please sign in to comment.