|
Post by anixx on Mar 25, 2024 11:09:21 GMT -8
I have noticed that the "unextend frames" mod from the repo does not fix the photo viewer and the incoming connections dialog. So, I decided to write a small mod that fixes the transparency issues in Classic theme. Please, test it under various themes including the Basic theme.
// ==WindhawkMod== // @id classic-theme-transparency-fix // @name Classic theme transparency fix // @description Fixes transparency glitches in Classic theme // @version 1.0 // @author anixx // @github https://github.com/Anixx // @include * // @include dllhost.exe
// ==/WindhawkMod==
// ==WindhawkModReadme== /* This mod includes a subset of functionality of the mod "DWM Unextend frames", but only includes fixes needed for Classic theme. It hooks less functions, is more lightweight, does not use pointer arithmetic and the code is more compact. It also injects dllhost.exe by default, which is needed for Windows Photo Viewer and some dialogs. */ // ==/WindhawkModReadme==
typedef HRESULT (WINAPI *DwmIsCompositionEnabled_t)(BOOL *); DwmIsCompositionEnabled_t DwmIsCompositionEnabled_orig; HRESULT WINAPI DwmIsCompositionEnabled_hook(BOOL *pfEnabled) { *pfEnabled = FALSE; return S_OK; }
typedef BOOL (WINAPI *IsCompositionActive_t)(void); IsCompositionActive_t IsCompositionActive_orig; BOOL WINAPI IsCompositionActive_hook() { return FALSE; }
BOOL Wh_ModInit() { HMODULE dwmapiModule = LoadLibrary(L"dwmapi.dll"); Wh_SetFunctionHook((void*)GetProcAddress(dwmapiModule, "DwmIsCompositionEnabled"), (void*)DwmIsCompositionEnabled_hook, (void**)&DwmIsCompositionEnabled_orig); HMODULE uxthemeModule = LoadLibrary(L"uxtheme.dll"); Wh_SetFunctionHook((void*)GetProcAddress(uxthemeModule, "IsCompositionActive"), (void*)IsCompositionActive_hook, (void**)&IsCompositionActive_orig); return TRUE; }
|
|
|
Post by OrthodoxWin32 on Mar 25, 2024 12:24:52 GMT -8
anixx Is this mod intended to be used in addition to or instead of DWM unextend frames ?
|
|
|
Post by Sennanon on Mar 25, 2024 12:37:23 GMT -8
I had a similar issue with photo viewer and the unextended frames mod, adding this line to the mod fixes it though
// @include dllhost.exe
|
|
|
Post by OrthodoxWin32 on Mar 25, 2024 12:50:11 GMT -8
I had a similar issue with photo viewer and the unextended frames mod, adding this line to the mod fixes it though
// @include dllhost.exe
I confirm that it works.
|
|
|
Post by anixx on Mar 25, 2024 13:09:26 GMT -8
anixx Is this mod intended to be used in addition to or instead of DWM unextend frames ? Instead.
This mod includes less hooks, so maybe this is enough. Also, it should be architecture-independent.
|
|
|
Post by anixx on Mar 25, 2024 13:25:14 GMT -8
I had a similar issue with photo viewer and the unextended frames mod, adding this line to the mod fixes it though
// @include dllhost.exe
I wonder which is better to inject, dllhost.exe or rundll32.exe
|
|
|
Post by Sennanon on Mar 25, 2024 14:10:57 GMT -8
I had a similar issue with photo viewer and the unextended frames mod, adding this line to the mod fixes it though
// @include dllhost.exe
I wonder which is better to inject, dllhost.exe or rundll32.exe It's weird actually, I noticed photo viewer opens most image formats in the process dllhost.exe except for the webp format which opens in rundll32 in the task manager.
I'm not sure how this works technically speaking, but opening webps with the original mod running actually fixed the transparency issue, so I'm just assuming windhawk injects into rundll32 without issue.
|
|
|
Post by OrthodoxWin32 on Mar 25, 2024 15:21:10 GMT -8
It's weird actually, I noticed photo viewer opens most image formats in the process dllhost.exe except for the webp format which opens in rundll32 in the task manager.
I'm not sure how this works technically speaking, but opening webps with the original mod running actually fixed the transparency issue, so I'm just assuming windhawk injects into rundll32 without issue.
You need to test opening a webp image without injecting dllhost.exe, and see if transparency is present. If this is not the case, it means that Windhawk does not consider rundll32.dll to be a critical process. But it is clear that Windhawk considers dllhost.exe to be a critical process, since it must be explicitly mentioned.
|
|
|
Post by OrthodoxWin32 on Mar 25, 2024 16:00:19 GMT -8
Instead.
This mod includes less hooks, so maybe this is enough. Also, it should be architecture-independent.
I tested your mod, in the classic theme and the basic theme (on aero and aerolite). I tested a recent version of SumatraPDF, Explorer Address Bar, Photo Viewer, msdt.exe and mobsync.exe.
The only issue I saw is on msdt.exe with the basic theme (in classic theme, there don't seem to be any issue) : On the Aero style, the icon and text in the title bar are too high, and the text is too far to the left. On the Aerolite style, the icon and the text of the title bar are too high, however the text is not too far to the left. This issue does not occur with DWM unextend frame. I haven't tested msdt.exe with the Aerolite in high contrast mode, but I assume the problem is the same as on standard Aerolite-Basic style.
|
|
|
Post by Sennanon on Mar 25, 2024 16:00:54 GMT -8
It's weird actually, I noticed photo viewer opens most image formats in the process dllhost.exe except for the webp format which opens in rundll32 in the task manager.
I'm not sure how this works technically speaking, but opening webps with the original mod running actually fixed the transparency issue, so I'm just assuming windhawk injects into rundll32 without issue.
You need to test opening a webp image without injecting dllhost.exe, and see if transparency is present. If this is not the case, it means that Windhawk does not consider rundll32.dll to be a critical process. But it is clear that Windhawk considers dllhost.exe to be a critical process, since it must be explicitly mentioned. I technically did, I only saw this behavior before I came up with a fix and I checked multiple times, although I only figured out they were different processes after checking task manager I think you're right about it being a critical system process, I have windhawk set to load into critical system processes only if targeted explicitly.
|
|
|
Post by anixx on Mar 25, 2024 16:21:30 GMT -8
Instead.
This mod includes less hooks, so maybe this is enough. Also, it should be architecture-independent.
I tested your mod, in the classic theme and the basic theme (on aero and aerolite). I tested a recent version of SumatraPDF, Explorer Address Bar, Photo Viewer, msdt.exe and mobsync.exe.
The only issue I saw is on msdt.exe with the basic theme (in classic theme, there don't seem to be any issue) : On the Aero style, the icon and text in the title bar are too high, and the text is too far to the left. On the Aerolite style, the icon and the text of the title bar are too high, however the text is not too far to the left. This issue does not occur with DWM unextend frame. I haven't tested msdt.exe with the Aerolite in high contrast mode, but I assume the problem is the same as on standard Aerolite-Basic style.
Okay, so I will describe it as a fix for Classic theme specifically.
|
|
|
Post by nonameneeded on Mar 25, 2024 16:25:26 GMT -8
|
|
|
Post by anixx on Mar 25, 2024 16:49:56 GMT -8
Does it start with "unextend frames" mod?
|
|
|
Post by nonameneeded on Mar 25, 2024 16:51:11 GMT -8
Yes it does
|
|
|
Post by anixx on Mar 25, 2024 16:59:04 GMT -8
I tried to install this program but get "Couldn't load XPCOM" error.
Does it start under classic theme without these mods?
|
|
|
Post by nonameneeded on Mar 25, 2024 17:14:02 GMT -8
That's the exact error I get too (with your mod).
Yes, it starts normally, your mod seems to be the only one it's not compatible with.
|
|
|
Post by anixx on Mar 25, 2024 17:18:37 GMT -8
It seems it is running a customized version of Firefox... I've added zotero to the exclusion list.
|
|
|
Post by nonameneeded on Mar 25, 2024 17:31:05 GMT -8
Yes it's based on Firefox.
The "DWM Unextend Frame" mod works just fine with Zotero so I don't need your mod anyway. I just wanted to provide feedback and yes, I think it's a good idea to add Zotero.exe to the exclusion list.
|
|
|
Post by anixx on Mar 25, 2024 17:54:30 GMT -8
I will look if this is a systematic problem of just an exception. If it is systematic, then more hooks can be included from DWM unextend frames mod.
|
|
|
Post by anixx on Mar 25, 2024 18:36:29 GMT -8
Yes it's based on Firefox. The "DWM Unextend Frame" mod works just fine with Zotero so I don't need your mod anyway. I just wanted to provide feedback and yes, I think it's a good idea to add Zotero.exe to the exclusion list. Okay, now it should work. It was a bug, now fixed. There is no need for exceptions now.
|
|