Translucent Windows v1.8.0 - #4818
Conversation
* Some settings that can be considered outside the scope of translucent effects are removed due to my limited free time to maintain these features, and fortunately the Windhawk community has provided some separate tweaks for those listed below. * Settings removed: - Border color setting - replacement: [Window Border Customizer](https://windhawk.net/mods/window-border-customizer) by [Lockframe](https://github.com/Lockframe). - Title bar color - replacement: [Auto Custom Title Bar Colors](https://windhawk.net/mods/auto-custom-titlebar-colors) by [Louis047](https://github.com/Louis047). - Window Corner Type - replacement: [Custom Window Corner Radius](https://windhawk.net/mods/custom-corner-radius) by [m417z](https://github.com/m417z). - Titlebar text color. - Rainbow effect - Very high performance overhead, e.g. 30% usage on a modern midrange GPU. - Extend effects into entire window - Will be enabled by default when a translucent effect is selected. - Immersive darkmode title bar - Will be enabled by default when the system is in dark mode. * Added compatibility with [Windows 11 File Explorer Styler](https://windhawk.net/mods/windows-11-file-explorer-styler). * Big improvements of system colors without the need of applying SetSysColors - "New system color" global setting. * Processes starting from given subdirectories can be controlled as a whole in the mod settings. * Major improvements to system colors without the need to apply the global setting SetSysColors - "New system color". * Processes launched from given subdirectories can be ruled as a whole inside mod's settings. * Numerous improvements and additions to theme customization. - Fixed chevron arrow scaling in treeview. - Improved buttons pill (e.g. treeview, tabs) - Fixed properties window background coloring without the need to restart explorer. - Adjusted the size of the custom scrollbar close to the original. - Recolored black text in dark mode (e.g. syslinks, address bar dropdown text, context menu icons) - Alpha blended more UI elements (e.g. treeview separator, highlighted text accent background) - Removed dark gray bottom part in explorer dialogs in dark mode (e.g. Open/Save dialogs) - Removed Windows brand logo background in dialogs (e.g. winver.exe) - Improved text composition performance.
|
Thanks. Please fix the CI errors regarding Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. 1. if (!IsWindow(hwndTreeView) || !IsWindowClass(hwndTreeView, L"SysTreeView32"))
Fallback(L"Not valid TreeView window"); // calls orig, then CONTINUES
...
if (!SendMessageW(hwndTreeView, TVM_GETITEMRECT, 0, (LPARAM)&treeItemRect))
Fallback(); // calls orig, then CONTINUES
if (!g_d2dFactory)
Fallback(); // calls orig, then CONTINUES
if (!g_themeCache.navigationdivider[0])
if (!g_themeCache.CacheNavigationDivider(hdc))
Fallback(); // calls orig, then CONTINUES
// ...runs anyway with a possibly-invalid handle / zeroed rect / null cache
DrawNineGridStretch(hdc, g_themeCache.navigationdivider[0], &lineRc, 1, 1, 0, 0);Consequences on the failure paths: the original is drawn and the custom divider is drawn on top (double draw); when the tree-view handle can't be resolved, if (!IsWindow(hwndTreeView) || !IsWindowClass(hwndTreeView, L"SysTreeView32"))
return Fallback(L"Not valid TreeView window");
...
if (!SendMessageW(hwndTreeView, TVM_GETITEMRECT, 0, (LPARAM)&treeItemRect))
return Fallback();
if (!g_d2dFactory)
return Fallback();
if (!g_themeCache.navigationdivider[0] && !g_themeCache.CacheNavigationDivider(hdc))
return Fallback();2. std::array<HBRUSH, COLOR_MENUBAR + 1> g_themeCachedCustomSysColorBrushes {nullptr};
std::array<HBRUSH, COLOR_MENUBAR + 1> g_themeCachedDefaultSysColorBrushes {nullptr};3. Optional improvements
Minor polish — none of this affects users, so it's your call.
Functionality notes
Non-critical observations about the feature itself.
|
| #include <d2d1.h> | ||
| #include <wrl.h> | ||
| #include <ShellScalingApi.h> | ||
|
|
||
| #define RECTWIDTH(lprc) ((lprc)->right - (lprc)->left) | ||
| #define RECTHEIGHT(lprc) ((lprc)->bottom - (lprc)->top) | ||
|
|
||
| #define WM_CTLCOLOR 0x19 |
Submission reviewLooks good. See remaining items below. 1. Simplest robust fix — size the arrays to cover index std::array<HBRUSH, COLOR_MENUBAR + 1> g_themeCachedCustomSysColorBrushes {nullptr};
std::array<HBRUSH, COLOR_MENUBAR + 1> g_themeCachedDefaultSysColorBrushes {nullptr};
...
HBRUSH WINAPI HookedGetSysColorBrush(INT nIndex)
{
if (nIndex < 0 || nIndex > COLOR_MENUBAR) // out-of-range → let the original handle it
return GetSysColorBrush_orig(nIndex);
auto& cacheArray = g_DefaultSysColors ? g_themeCachedDefaultSysColorBrushes : g_themeCachedCustomSysColorBrushes;
HBRUSH cachedBrush = cacheArray[nIndex]; // no -1
...2. Optional improvements
Minor polish — none of this affects users, so it's your call.
|
Restart explorer or the system and see if the problem persists; it doesn't happen to me. |
I restarted explorer after disabling all other mods, the behaviour remains the same. i am on 26200.8894 (arm64) |
Symbol hooks are being used in this version, and your problem is likely due to the ARM architecture. |
Here you go |
|
Here are my logs from a native Notepad: Details
The unresolved symbols: Other architectures on ARM64 may have other symbols, and it can be messy. After you fix this, I can test x86 and x64 on ARM64. Let me know. |
|
Below is another review round with new findings which seem to be worth addressing. Regarding 1, it's worth testing the mod with 32-bit apps. Also let me know if you need help reversing to verify that any of the calling conventions match. Submission review
Optional improvements
Minor polish — none of this affects users in practice, so it's your call.
Functionality notes
Non-critical observations about the feature behavior itself.
|
@m417z Changing the calling convention from #ifdef _WIN64
#define STDCALL __cdecl
#define SSTDCALL L"__cdecl"
#else
#define STDCALL __stdcall
#define SSTDCALL L"__stdcall"
#endif |
|
After doing a more comprehensive check, I believe only these functions need adjustment:
I looked at the assembly, but didn't test the actual mod. |
|
Looks like the only things that's left is ARM64 support. Let me know if you need help with that. |
@m417z Thanks! Unfortunately, I cannot run tests on ARM, so any help would be appreciated. |
|
I did some testing, and the results are not great.
32-bit processes seem to work fine. As a best-effort solution, you can:
|
The symbols are found in the V6 comctl32.dll which is placed inside
If this happens, these symbols fail to hook entirely. This makes the modification only partially supported by default on ARM64. Code example
VOID Comctl32Hooks()
{
WindhawkUtils::SYMBOL_HOOK comctl32_dll_hooks[] =
{
{
{
#ifdef _WIN64
L"SHThemeDrawText"
#else
L"_SHThemeDrawText@56"
#endif
},
&SHThemeDrawText_orig,
Hooked_SHThemeDrawText,
FALSE
},
// SHThemeFillTextRect is 64-bit only
// 32-bit version is implemented inside SHThemeDrawText
#ifdef _WIN64
{
{
L"SHThemeFillTextRect"
},
&SHThemeFillTextRect_orig,
HookedSHThemeFillTextRect,
FALSE
},
#endif
{
{
#ifdef _WIN64
L"FillRectClr"
#else
L"_FillRectClr@12"
#endif
},
&FillRectClr_orig,
HookedFillRectClr,
FALSE
},
{
{
#ifdef _WIN64
L"struct HBRUSH__ * __cdecl ListBox_GetBrush(struct tagLBIV *,struct HBRUSH__ * *)"
#else
L"struct HBRUSH__ * __stdcall ListBox_GetBrush(struct tagLBIV *,struct HBRUSH__ * *)"
#endif
},
&ListBox_GetBrush_orig,
HookedListBox_GetBrush,
FALSE
},
{
{
#ifdef _WIN64
L"void __cdecl ComboEx_OnDrawItem(struct COMBOEX *,struct tagDRAWITEMSTRUCT *)"
#else
L"void __stdcall ComboEx_OnDrawItem(struct COMBOEX *,struct tagDRAWITEMSTRUCT *)"
#endif
},
&ComboEx_OnDrawItem_orig,
HookedComboEx_OnDrawItem,
FALSE
},
};
HMODULE hComCtl32 = LoadComCtlModule();
if (!hComCtl32) {
Wh_Log(L"Failed to load comctl32.dll");
return;
}
if (!WindhawkUtils::HookSymbols(hComCtl32, comctl32_dll_hooks, ARRAYSIZE(comctl32_dll_hooks))) {
Wh_Log(L"Failed to hook one or more symbol functions in comctl32.dll");
return;
}
} |
The dll inside
Yes. Just need to make sure to avoid things such as calling via original function pointers without checking for null. |
Like this ? code example
// Intercept the windows branding logo image (e.g winver, shutdown dialog, regedit etc.)
// Winver loads the bitmap using LoadAboutBitmaps() routine, shutdown dialog using LoadBrandingBitmap().
HANDLE (STDCALL *BrandingLoadImage_orig)(LPCWSTR, UINT, UINT, INT, INT, UINT);
HANDLE STDCALL HookedBrandingLoadImage(LPCWSTR pszBrand, UINT uID, UINT type, INT cx, INT cy, UINT fuLoad)
{
// Guard against calling via a null original function pointer
if (!BrandingLoadImage_orig)
return NULL;
HANDLE hImage = BrandingLoadImage_orig(pszBrand, uID, type, cx, cy, fuLoad);
// The image resource is fetched from basebrd.dll resource image 121.
if (!wcscmp(pszBrand, L"Basebrd") && uID == 121)
RecolorBrandingLogoBackground(reinterpret_cast<HBITMAP>(hImage));
return hImage;
}
VOID WinbrandHooks()
{
WindhawkUtils::SYMBOL_HOOK winbrand_dll_hooks[] =
{
{
{
#ifdef _WIN64
L"BrandingLoadImage"
#else
L"_BrandingLoadImage@24"
#endif
},
&BrandingLoadImage_orig,
HookedBrandingLoadImage,
FALSE
},
};
HMODULE hWinbrand = LoadLibraryEx(L"winbrand.dll", NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
if (!hWinbrand ) {
Wh_Log(L"Failed to load winbrand.dll");
return;
}
if (!WindhawkUtils::HookSymbols(hWinbrand , winbrand_dll_hooks, ARRAYSIZE(winbrand_dll_hooks))) {
Wh_Log(L"Failed to hook one or more symbol functions in winbrand.dll");
return;
}
} |
|
That's not necessary, |
There is no case of this. Thanks for the help! |
|
What about this?
Or do you prefer the whole |

Changelog
If this pull request updates an existing mod, describe the changes below:
Some settings that can be considered outside the scope of translucent effects are removed due to my limited free time to maintain these features, fortunately the Windhawk community has provided some separate mods for those listed below.
Settings removed:
Added compatibility with Windows 11 File Explorer Styler.
System color improvements without the need to apply the SetSysColors API - Global setting "New system colors". Related topic: [Translucent Window] Dark/black background artifacts even for excluded apps (e.g. Office) #2010
Processes launching from given subdirectories can be ruled/excluded as a whole in the mod settings.
Numerous improvements and additions to theme customization.
Mod authorship
If this pull request introduces a new mod, please complete the section below.
This mod was created by:
Please select the options that best apply. Your selection does not affect the acceptance criteria, but it helps reviewers understand the context of the code and provide relevant feedback.