Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Jan 30, 2024 2:45:34 GMT -8
This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme. No more need to run ApplicationFrameHost before enabling Classic! This works by hardcoding the splash fade animation values instead of fetching them from msstyles. Note: do not apply this to Explorer, as doing so will cause Explorer to crash repeatedly. I'm not sure if there's a UWP app hosted by Explorer that gets broken with the Classic theme. Also the native frames from the screenshot is not a part of this mod; use this mod for that. Code {Spoiler}
// ==WindhawkMod== // @id classic-uwp-fix // @name Classic UWP Fix // @description Fix for UWPs breaking with Classic theme // @version 0.3 // @author Ingan121 // @github https://github.com/Ingan121 // @homepage https://www.ingan121.com/ // @include ApplicationFrameHost.exe // @include explorer.exe // @include ShellAppRuntime.exe // @include CustomShellHost.exe // @architecture x86-64 // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Classic UWP Fix This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme.
No more need to run ApplicationFrameHost before enabling Classic!
This works by hardcoding the splash fade animation values instead of fetching them from msstyles. */ // ==/WindhawkModReadme==
#include <windhawk_utils.h>
typedef INT64 (* WINAPI AnimationHelpers__LoadThemeTransform_t)(void *, UINT, INT64 *, int, INT64 *, struct TA_TIMINGFUNCTION *); AnimationHelpers__LoadThemeTransform_t AnimationHelpers__LoadThemeTransform_orig; INT64 WINAPI AnimationHelpers__LoadThemeTransform_hook( void *pThis, UINT a2, INT64 *out, int type, INT64 *a5, struct TA_TIMINGFUNCTION *a6 ){ if (type == 28) { out[0] = 2; out[1] = 0; out[2] = 2; out[3] = 1.0f; out[4] = 1; out[5] = 0; out[6] = 1.0f; } else { AnimationHelpers__LoadThemeTransform_orig(pThis, a2, out, type, a5, a6); } return 0; }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { Wh_Log(L"Init");
HMODULE hAppFrameModule = LoadLibraryW(L"ApplicationFrame.dll"); if(!hAppFrameModule) { Wh_Log(L"Failed to load ApplicationFrame.dll"); return FALSE; } WindhawkUtils::SYMBOL_HOOK hooks[] = { { { L"long __cdecl AnimationHelpers::LoadThemeTransform(int,int,struct TA_TRANSFORM *,unsigned long,struct TA_TIMINGFUNCTION *,unsigned long)" }, (void **)&AnimationHelpers__LoadThemeTransform_orig, (void *)AnimationHelpers__LoadThemeTransform_hook, false } };
if (!WindhawkUtils::HookSymbols( hAppFrameModule, hooks, ARRAYSIZE(hooks) )) { Wh_Log(L"Failed to hook"); return FALSE; }
return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { Wh_Log(L"Uninit"); }
|
|
|
Post by anixx on Jan 30, 2024 2:58:42 GMT -8
This is simply Great!
|
|
|
Post by OrthodoxWin32 on Jan 30, 2024 3:38:17 GMT -8
So this is the invention of the year! Congratulations Ingan121.
|
|
clara
Sophomore Member
Posts: 118
|
Post by clara on Jan 30, 2024 3:42:51 GMT -8
Oh my god. Thank you so much.
Edit: Testing some UWP apps, the frame mod also works as it should. Wonderful. Windhawk is amazing.
|
|
|
Post by anixx on Jan 30, 2024 3:56:29 GMT -8
Adding ApplicationFrameHost.exe to this mod, restores prominent window frame and shadow:
// ==WindhawkMod== // @id classic-browser-fix // @name Unthemed+Nocomposition // @description Removes composition from windows and sets Light window frame // @version 0.1 // @include msedge.exe // @include chrome.exe // @include steam.exe // @include ApplicationFrameHost.exe // @compilerOptions -luxtheme // ==/WindhawkMod==
#include <uxtheme.h>
BOOL Wh_ModInit() { Wh_Log(L"Init"); SetThemeAppProperties(0); return TRUE; }
|
|
|
Post by anixx on Jan 30, 2024 4:18:15 GMT -8
Oh my god. Thank you so much.
Edit: Testing some UWP apps, the frame mod also works as it should. Wonderful. Windhawk is amazing.
Not that good on Win11, there are gaps and the icon and buttons are blurry. Also, the default icon is better either removed or fixed to coincide with the taskbar icon.
|
|
kirta
Freshman Member
Posts: 59
OS: Windows 10 LTSC 2021
|
Post by kirta on Jan 30, 2024 5:21:54 GMT -8
Adding ApplicationFrameHost.exe to this mod, restores prominent window frame and shadow: // ==WindhawkMod== // @id classic-browser-fix // @name Unthemed+Nocomposition // @description Removes composition from windows and sets Light window frame // @version 0.1 // @include msedge.exe // @include chrome.exe // @include steam.exe // @include ApplicationFrameHost.exe // @compilerOptions -luxtheme // ==/WindhawkMod==
#include <uxtheme.h>
BOOL Wh_ModInit() { Wh_Log(L"Init"); SetThemeAppProperties(0); return TRUE; }
if we use this mod we don't have to start ApplicationFrameHost.exe at startup anymore right?
|
|
|
Post by anixx on Jan 30, 2024 5:26:51 GMT -8
Adding ApplicationFrameHost.exe to this mod, restores prominent window frame and shadow: // ==WindhawkMod== // @id classic-browser-fix // @name Unthemed+Nocomposition // @description Removes composition from windows and sets Light window frame // @version 0.1 // @include msedge.exe // @include chrome.exe // @include steam.exe // @include ApplicationFrameHost.exe // @compilerOptions -luxtheme // ==/WindhawkMod==
#include <uxtheme.h>
BOOL Wh_ModInit() { Wh_Log(L"Init"); SetThemeAppProperties(0); return TRUE; }
if we use this mod we don't have to start ApplicationFrameHost.exe at startup anymore right? Not this one but the one in the first post in this thread. This one only re-adds window frame and shadow to the UWP apps after the first one.
|
|
|
Post by anixx on Feb 1, 2024 22:39:42 GMT -8
This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme. No more need to run ApplicationFrameHost before enabling Classic! This works by hardcoding the splash fade animation values instead of fetching them from msstyles. Note: do not apply this to Explorer, as doing so will cause Explorer to crash repeatedly. I'm not sure if there's a UWP app hosted by Explorer that gets broken with the Classic theme. Also the native frames from the screenshot is not a part of this mod; use this mod for that. Code {Spoiler}
// ==WindhawkMod== // @id classic-uwp-fix // @name Classic UWP Fix // @description Fix for UWPs breaking with Classic theme // @version 0.1 // @author Ingan121 // @github https://github.com/Ingan121 // @homepage https://www.ingan121.com/ // @include ApplicationFrameHost.exe // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Classic UWP Fix This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme.
No more need to run ApplicationFrameHost before enabling Classic!
This works by hardcoding the splash fade animation values instead of fetching them from msstyles. */ // ==/WindhawkModReadme==
// ==WindhawkModSettings== // ==/WindhawkModSettings==
#include <windhawk_utils.h>
typedef INT64 (* AnimationHelpers__LoadThemeTransform_t)(void *, UINT, INT64 *, struct TA_TRANSFORM *, INT64 *, struct TA_TIMINGFUNCTION *); AnimationHelpers__LoadThemeTransform_t AnimationHelpers__LoadThemeTransform_orig; INT64 __fastcall AnimationHelpers__LoadThemeTransform_hook( void *pThis, UINT a2, INT64 *out, struct TA_TRANSFORM *a4, INT64 *a5, struct TA_TIMINGFUNCTION *a6 ){ out[0] = 2; out[1] = 0; out[2] = 2; out[3] = 1065353216; out[4] = 1; out[5] = 0; out[6] = 1065353216; return 0; }
void LoadSettings() { }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { Wh_Log(L"Init");
LoadSettings();
HMODULE hAppFrameModule = LoadLibraryW(L"ApplicationFrame.dll"); if(!hAppFrameModule) { Wh_Log(L"Failed to load ApplicationFrame.dll"); return FALSE; } WindhawkUtils::SYMBOL_HOOK hooks[] = { { { L"long __cdecl AnimationHelpers::LoadThemeTransform(int,int,struct TA_TRANSFORM *,unsigned long,struct TA_TIMINGFUNCTION *,unsigned long)" }, (void **)&AnimationHelpers__LoadThemeTransform_orig, (void *)AnimationHelpers__LoadThemeTransform_hook, false } };
if (!WindhawkUtils::HookSymbols( hAppFrameModule, hooks, ARRAYSIZE(hooks) )) { Wh_Log(L"Failed to hook"); return FALSE; }
return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { Wh_Log(L"Uninit"); }
// The mod setting were changed, reload them. void Wh_ModSettingsChanged() { Wh_Log(L"SettingsChanged");
LoadSettings(); }
By all means, please submit the mod to the Windhawk repo. It turned out to be easy, and I have submitted my Ctassic Theme mod there as well.
|
|
Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Feb 2, 2024 9:36:11 GMT -8
This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme. No more need to run ApplicationFrameHost before enabling Classic! This works by hardcoding the splash fade animation values instead of fetching them from msstyles. Note: do not apply this to Explorer, as doing so will cause Explorer to crash repeatedly. I'm not sure if there's a UWP app hosted by Explorer that gets broken with the Classic theme. Also the native frames from the screenshot is not a part of this mod; use this mod for that. Code {Spoiler}
// ==WindhawkMod== // @id classic-uwp-fix // @name Classic UWP Fix // @description Fix for UWPs breaking with Classic theme // @version 0.1 // @author Ingan121 // @github https://github.com/Ingan121 // @homepage https://www.ingan121.com/ // @include ApplicationFrameHost.exe // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Classic UWP Fix This mod fixes UWP apps getting stuck at the splash screen when using the Classic theme.
No more need to run ApplicationFrameHost before enabling Classic!
This works by hardcoding the splash fade animation values instead of fetching them from msstyles. */ // ==/WindhawkModReadme==
// ==WindhawkModSettings== // ==/WindhawkModSettings==
#include <windhawk_utils.h>
typedef INT64 (* AnimationHelpers__LoadThemeTransform_t)(void *, UINT, INT64 *, struct TA_TRANSFORM *, INT64 *, struct TA_TIMINGFUNCTION *); AnimationHelpers__LoadThemeTransform_t AnimationHelpers__LoadThemeTransform_orig; INT64 __fastcall AnimationHelpers__LoadThemeTransform_hook( void *pThis, UINT a2, INT64 *out, struct TA_TRANSFORM *a4, INT64 *a5, struct TA_TIMINGFUNCTION *a6 ){ out[0] = 2; out[1] = 0; out[2] = 2; out[3] = 1065353216; out[4] = 1; out[5] = 0; out[6] = 1065353216; return 0; }
void LoadSettings() { }
// The mod is being initialized, load settings, hook functions, and do other // initialization stuff if required. BOOL Wh_ModInit() { Wh_Log(L"Init");
LoadSettings();
HMODULE hAppFrameModule = LoadLibraryW(L"ApplicationFrame.dll"); if(!hAppFrameModule) { Wh_Log(L"Failed to load ApplicationFrame.dll"); return FALSE; } WindhawkUtils::SYMBOL_HOOK hooks[] = { { { L"long __cdecl AnimationHelpers::LoadThemeTransform(int,int,struct TA_TRANSFORM *,unsigned long,struct TA_TIMINGFUNCTION *,unsigned long)" }, (void **)&AnimationHelpers__LoadThemeTransform_orig, (void *)AnimationHelpers__LoadThemeTransform_hook, false } };
if (!WindhawkUtils::HookSymbols( hAppFrameModule, hooks, ARRAYSIZE(hooks) )) { Wh_Log(L"Failed to hook"); return FALSE; }
return TRUE; }
// The mod is being unloaded, free all allocated resources. void Wh_ModUninit() { Wh_Log(L"Uninit"); }
// The mod setting were changed, reload them. void Wh_ModSettingsChanged() { Wh_Log(L"SettingsChanged");
LoadSettings(); }
By all means, please submit the mod to the Windhawk repo. It turned out to be easy, and I have submitted my Ctassic Theme mod there as well. Done
|
|
|
Post by anixx on Feb 2, 2024 10:19:06 GMT -8
Thank you very much!
|
|
AnyKey
Sophomore Member
Posts: 248
OS: Windows 10 Pro 22H2
Theme: XP Classic Theme
CPU: AMD Ryzen 7 3700X
RAM: 16 GB 1333 MHz DDR4
GPU: Nvidia Geforce RTX 2070 Super
|
Post by AnyKey on Feb 25, 2024 9:44:07 GMT -8
Is this also fixable? When trying to sign in to UWP apps with classic theme enabled, it will be interrupted.
|
|
Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Feb 26, 2024 10:21:39 GMT -8
Is this also fixable? When trying to sign in to UWP apps with classic theme enabled, it will be interrupted. Fixed in 0.3. This mod now injects into Explorer. The reason why it was crashing Explorer was because it uses the same function for fetching a different animation on startup (which also breaks on Classic but doesn't seem to cause visual breakages). Will upload to the repo if no issues are found.
Attachments:
|
|
|
Post by anixx on Feb 26, 2024 10:58:03 GMT -8
Is this also fixable? When trying to sign in to UWP apps with classic theme enabled, it will be interrupted. Fixed in 0.3. This mod now injects into Explorer. The reason why it was crashing Explorer was because it uses the same function for fetching a different animation on startup (which also breaks on Classic but doesn't seem to cause visual breakages). Will upload to the repo if no issues are found.
I think, on Win11 Explorer has nothing to do with UWP. Maybe is is better to make a separate mod for Win10 Explorer so not to inject Explorer in Win11? Especially, if these two fixes do not share the code.
|
|
Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Feb 26, 2024 13:15:49 GMT -8
Fixed in 0.3. This mod now injects into Explorer. The reason why it was crashing Explorer was because it uses the same function for fetching a different animation on startup (which also breaks on Classic but doesn't seem to cause visual breakages). Will upload to the repo if no issues are found.
I think, on Win11 Explorer has nothing to do with UWP. Maybe is is better to make a separate mod for Win10 Explorer so not to inject Explorer in Win11? Especially, if these two fixes do not share the code. It is still hosted by explorer.exe on Win11 (at least on 22H2). Attachments:
|
|
|
Post by anixx on Feb 26, 2024 14:41:25 GMT -8
I think, on Win11 Explorer has nothing to do with UWP. Maybe is is better to make a separate mod for Win10 Explorer so not to inject Explorer in Win11? Especially, if these two fixes do not share the code. It is still hosted by explorer.exe on Win11 (at least on 22H2). What is it? I cannot tell what dos the screenshot show.
|
|
Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Feb 26, 2024 19:41:17 GMT -8
It is still hosted by explorer.exe on Win11 (at least on 22H2). What is it? I cannot tell what dos the screenshot show. The sign-in window runs in the explorer.exe process, on both Win10 and Win11. This mod works without problems on Win11. Additionally, the same sign-in window can also be hosted by ShellAppRuntime.exe or CustomShellHost.exe (if you kill Explorer and run ShellAppRuntime instead, or for the latter if you use the assigned access/kiosk mode), so I added these as well. Don't worry, those two processes don't run at all normally.
|
|
|
Post by OrthodoxWin32 on Feb 27, 2024 3:28:28 GMT -8
The sign-in window runs in the explorer.exe process, on both Win10 and Win11. This mod works without problems on Win11. Additionally, the same sign-in window can also be hosted by ShellAppRuntime.exe or CustomShellHost.exe (if you kill Explorer and run ShellAppRuntime instead, or for the latter if you use the assigned access/kiosk mode), so I added these as well. Don't worry, those two processes don't run at all normally.
Is it possible to use ShellAppRuntime.exe or CustomShellHost.exe in Windows 10, to allow UWP applications to run without Explorer ?
|
|
Ingan121
Sophomore Member
Posts: 104
OS: Windows 10 22H2
Theme: Arc dark
CPU: AMD Ryzen 7 1700 Eight-Core Processor
RAM: 32GB
GPU: NVIDIA GeForce GTX 1050 Ti
Computer Make/Model: VPS-ish thingy (ComViewers)
|
Post by Ingan121 on Feb 27, 2024 4:15:24 GMT -8
The sign-in window runs in the explorer.exe process, on both Win10 and Win11. This mod works without problems on Win11. Additionally, the same sign-in window can also be hosted by ShellAppRuntime.exe or CustomShellHost.exe (if you kill Explorer and run ShellAppRuntime instead, or for the latter if you use the assigned access/kiosk mode), so I added these as well. Don't worry, those two processes don't run at all normally.
Is it possible to use ShellAppRuntime.exe or CustomShellHost.exe in Windows 10, to allow UWP applications to run without Explorer ? ShellAppRuntime is perfect for that purpose, but it only exists on Windows 11. (It also registers itself as a shell so some alternative shells may not start.) CustomShellHost is pretty similar, but it requires a user account with assigned access enabled (which is a kiosk mode.) It does run on other sessions with runas, etc. but I'm not sure about the consequences of doing that.
|
|
AnyKey
Sophomore Member
Posts: 248
OS: Windows 10 Pro 22H2
Theme: XP Classic Theme
CPU: AMD Ryzen 7 3700X
RAM: 16 GB 1333 MHz DDR4
GPU: Nvidia Geforce RTX 2070 Super
|
Post by AnyKey on Feb 28, 2024 0:05:01 GMT -8
Fixed in 0.3. This mod now injects into Explorer. The reason why it was crashing Explorer was because it uses the same function for fetching a different animation on startup (which also breaks on Classic but doesn't seem to cause visual breakages). Will upload to the repo if no issues are found.
Confirmed working. Thank you. And no specific issues were found. I think it's okay to submit to the repository.
|
|