-
-
Notifications
You must be signed in to change notification settings - Fork 991
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable blue highlight in context menus #18
Comments
Not enough height is the reason of bule background looked so ugly. |
I don’t know, maybe take a look on the theme file, aero.msstyles, tinker a bit with it and see what you get. Don’t forget to disable theme signing! Good luck! |
ErickWei, Change color of background for menu: Change color of texts in menu: To change size of highlight, you need to replace a PNG file. I am 99% sure that this PNG file is not in MSSTYLES file. |
Also, do not forget to disable theme signing if you change the theme file. |
I installed UXThemePatcher for use custom theme. How to signing/disable signing custom theme? What exactly is theme signing? |
That. Why have you installed that? Why install stuff without reading about its purpose in the first place? It's not good computing practice at all. The themes service (provided by |
The signed themes are just those named exactly "aero.msstyles" or "aerolite.msstyles"? I copied the original aero.msstyles file and named the copy - "aerom.msstyles". Both files have identical content, but the copy is not signed because it just has a different name? |
No. The signature has nothing to do with the file name. A renamed file is still signed. If you experience different behavior between the 2 files, it's something else at play which is not obvious at all: |
I have no problems using custom theme on Windows 11. Everything works fine and as it should. Only Firefox has a problem when using is custom theme. :P |
StartAllBack has an option called "colorize everything with accent color", you can change the color without modifying the system file. Use IDA to open StartAllBackX64.dll, the following pseudo code may be related to "colorize everything with accent color". void __fastcall sub_18002B398(PTP_CALLBACK_INSTANCE Instance, PVOID Context, PTP_WORK Work)
{
unsigned int v3; // ebx
int v4; // edi
int i; // ecx
int v6; // edi
int j; // ecx
int k; // edi
int m; // edi
int n; // edi
int ii; // edi
int jj; // edi
int kk; // edi
int mm; // edi
int v15; // edi
int nn; // er9
int i1; // edi
int v18; // er9
int v19; // esi
int i2; // edi
COLORREF v21; // edi
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // rdi
COLORREF aRgbValues[4]; // [rsp+20h] [rbp-50h] BYREF
int nIndex[4]; // [rsp+30h] [rbp-40h] BYREF
char v27[16]; // [rsp+40h] [rbp-30h] BYREF
int v28; // [rsp+50h] [rbp-20h] BYREF
__int64 v29; // [rsp+58h] [rbp-18h]
__int64 v30; // [rsp+60h] [rbp-10h]
__int64 v31; // [rsp+B8h] [rbp+48h] BYREF
v3 = 0;
if ( !(unsigned int)sub_180020F7C(0i64, Context, Work) )
{
GetTickCount();
v29 = 0i64;
v28 = 1;
v30 = 1i64;
GdiplusStartup(&v31, &v28, v27);
sub_180029D40();
sub_180029F34();
v4 = 3;
for ( i = 3; (unsigned __int8)sub_18002A0F8(i); i = v4 )
++v4;
v6 = 3;
for ( j = 3; (unsigned __int8)sub_18002A65C(j); j = v6 )
++v6;
sub_180029CC0(L"Button", 1, 0, 2);
sub_180029CC0(L"Combobox", 1, 0, 2);
sub_180029CC0(L"Combobox", 4, 0, 2);
sub_180029CC0(L"Combobox", 5, 0, 2);
sub_180029CC0(L"Combobox", 6, 0, 2);
sub_180029CC0(L"Combobox", 7, 0, 2);
for ( k = 1; k <= 5; ++k )
sub_180029CC0(L"Listbox", k, 0, 2);
for ( m = 1; m <= 4; ++m )
sub_180029CC0(L"Toolbar", m, 0, 2);
for ( n = 1; n <= 4; ++n )
sub_180029CC0(L"BB::Toolbar", n, 0, 2);
for ( ii = 2; ii <= 6; ++ii )
sub_180029CC0(L"Explorer::TreeView", 1, ii, 2);
for ( jj = 2; jj <= 6; ++jj )
sub_180029CC0(L"Explorer::ListView", 1, jj, 2);
for ( kk = 1; kk <= 16; ++kk )
sub_180029CC0(L"ItemsView::ListView", 6, kk, 2);
sub_180029CC0(L"Header", 1, 0, 2);
sub_180029CC0(L"ItemsView::Header", 1, 0, 2);
sub_180029CC0(L"ItemsView", 3, 1, 2);
sub_180029CC0(L"ItemsView", 3, 2, 2);
sub_180029CC0(L"BreadcrumbBar", 1, 0, 2);
sub_180029CC0(L"PreviewPane", 1, 1, 2);
sub_180029CC0(L"CommandModule", 1, 0, 2);
for ( mm = 3; mm <= 5; ++mm )
sub_180029CC0(L"CommandModule", mm, 0, 2);
v15 = 3;
for ( nn = 3; (unsigned __int8)sub_180029CC0(L"SearchBox", 2, 0, nn); nn = v15 )
++v15;
for ( i1 = 3; i1 <= 8; ++i1 )
{
sub_180029CC0(L"Trackbar", i1, 0, 2);
v18 = 3;
v19 = 3;
while ( (unsigned __int8)sub_180029CC0(L"Trackbar", i1, 0, v18) )
v18 = ++v19;
}
for ( i2 = 1; i2 <= 4; ++i2 )
sub_180029CC0(L"Spin", i2, 0, 2);
*(__m128i *)nIndex = _mm_load_si128((const __m128i *)&xmmword_18006AA50);
aRgbValues[0] = 16382457;
v21 = 13924352;
if ( (unsigned __int8)sub_18002B340(0i64) )
v22 = sub_180020E84(4i64) & 0xFFFFFF;
else
LODWORD(v22) = 13924352;
aRgbValues[1] = v22;
if ( (unsigned __int8)sub_18002B340(0i64) )
v23 = sub_180020E84(5i64) & 0xFFFFFF;
else
LODWORD(v23) = 12609280;
aRgbValues[2] = v23;
if ( (unsigned __int8)sub_18002B340(0i64) )
v21 = sub_180020E84(4i64) & 0xFFFFFF;
aRgbValues[3] = v21;
v24 = 0i64;
while ( GetSysColor(nIndex[v24]) == aRgbValues[v24] )
{
++v3;
++v24;
if ( v3 >= 4 )
goto LABEL_45;
}
SetSysColors(4, nIndex, aRgbValues);
LABEL_45:
GetTickCount();
GdiplusShutdown(v31);
}
} __int64 __fastcall sub_180029CC0(LPCWSTR pszClassList, int iPartId, int iStateId, int iPropId)
{
HTHEME v7; // rbx
HBITMAP hbm; // [rsp+30h] [rbp-18h] BYREF
hbm = 0i64;
v7 = OpenThemeData(hwnd, pszClassList);
GetThemeBitmap(v7, iPartId, iStateId, iPropId, 1u, &hbm);
CloseThemeData(v7);
return sub_180029A84(hbm);
} char __fastcall sub_180029A84(HBITMAP hbm)
{
char v2; // di
void *v3; // rbx
HDC CompatibleDC; // rsi
void *v6; // rdi
HDC v7; // rbx
unsigned int v8; // eax
__int128 pv; // [rsp+50h] [rbp-29h] BYREF
__int128 v10; // [rsp+60h] [rbp-19h]
WCHAR ValueName[48]; // [rsp+70h] [rbp-9h] BYREF
DWORD cbData; // [rsp+E0h] [rbp+67h] BYREF
HKEY hKey; // [rsp+E8h] [rbp+6Fh] BYREF
void *pvBits; // [rsp+F0h] [rbp+77h] BYREF
pv = 0i64;
v10 = 0i64;
GetObjectW(hbm, 32, &pv);
if ( !hbm || WORD1(v10) != 32 )
return 0;
v2 = 0;
sub_18002B868(ValueName, L"%p", hbm);
RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\StartIsBack\\Recolor", 0, 0i64, 1u, 0xF003Fu, 0i64, &hKey, 0i64);
cbData = 4 * DWORD1(pv) * DWORD2(pv);
v3 = malloc(cbData);
if ( v3 )
{
if ( RegQueryValueExW(hKey, ValueName, 0i64, 0i64, (LPBYTE)v3, &cbData) )
{
if ( (unsigned __int8)sub_18002B340(0i64) )
{
GetBitmapBits(hbm, cbData, v3);
RegSetValueExW(hKey, ValueName, 0, 3u, (const BYTE *)v3, cbData);
}
}
else
{
v2 = 1;
SetBitmapBits(hbm, cbData, v3);
if ( !(unsigned __int8)sub_18002B340(0i64) )
RegDeleteValueW(hKey, ValueName);
}
free(v3);
}
RegCloseKey(hKey);
if ( !(unsigned __int8)sub_18002B340(0i64) )
return v2;
CompatibleDC = CreateCompatibleDC(0i64);
v6 = (void *)sub_1800556C0(DWORD1(pv), (unsigned int)-DWORD2(pv), &pvBits);
SelectObject(CompatibleDC, v6);
v7 = CreateCompatibleDC(0i64);
SelectObject(v7, hbm);
BitBlt(CompatibleDC, 0, 0, SDWORD1(pv), SDWORD2(pv), v7, 0, 0, 0xCC0020u);
DeleteDC(v7);
v8 = sub_180020E84(4i64);
sub_180029784(v6, v8);
SetBitmapBits(hbm, 4 * DWORD1(pv) * DWORD2(pv), pvBits);
DeleteDC(CompatibleDC);
DeleteObject(v6);
return 1;
} Is it possible to add this feature to ExplorerPatcher? |
I'd like to have an ability to use accent color everywhere. Unfortunately, the simple way to do this using To colorize the rest of Win32 UI, StartAllBack uses uxtheme API to get handle of UI controls bitmap and uses a complicated algorithm to replace the blue color (and its shades) with accent color. I've made a working prototype that replaces the original bitmaps with colored ones, but it is worthless unless needs some changes are made to get the blue replacement to work correctly. Implementing this functionality can also allow to replace the blue highlight with light gray without replacing .msstyles file. This means that ExplorerPatcher (although it would be better to separate this into a separate project), could have this functionality after combining these two approaches, in the end, having received what StartAllBack provides. I don't have a lot of Win32 API knowledge, but I can share the prototype if it may be useful for @valinet. EDIT: As I promised, here's a quick and dirty implementation of accent colorization feature based on replacing already-known color palette, it is primarily tested on Windows 10 and needs some work to get a more convenient lighter color based on accent color (plus, some elements need R=0 and A<255 to display correctly). |
Hi I have looked on the disassembly of SAB before as well, basically what @nullnullnullnull0 posted above and some more even. Indeed, it's a combination of simply hooking the classic Idk, I mean, sure, this should be built-in, that would be indeed professional, but it's Windows, after all, I just have other things to work on and things being blue do not bother me that much. Also, as you have discovered, it's not that easy and getting to a useful implementation regarding this takes some work, indeed. I don't have much extra time anyway, so personally, I won't be taking on implementing this. Of course, if you want to work on it, and maybe even one day contribute it to EP so it can be offered as functionality and a reference implementation for how such a thing should be done, I'd be more than happy to receive such a contribution, sure. But regarding me, personally, I won't take on this endevour any time soon, especially since I also do not use this feature. As I said, it's nice, but not something vital, like taskbar label buttons :D As well, if you want to, I encourage you to share any implementation that you have, maybe other people find it useful and something gets put together. You know, I am a single person as well, no matter how skilled one is, a day still has 24 hours of which you barely get a few, if any, to work on various stuff, so despite all my goodwill, enthusiasm and work I put, I can only do so much, so of course outside contributions are always welcome. Thank you |
As you probably know already, newer builds (including 22000.176 and 22449.1000) do not introduce many changes, if any, regarding the system theme, except another work-in-progress feature that it's said to look better but in reality does not necessarily do so: the blue highlight in the context menus:
![image](https://user-images.githubusercontent.com/6503598/132145284-fd74304d-3a07-487c-ba0f-583d99a6f946.png)
Personally, I prefer the old gray highlight which also filled better the containing rectangle. This is all dictated by the theme that's currently in use. Not much can be done from inside the applications that we hook, as those usually call things like
DrawThemeBackground
fromuxtheme
which supply them with the required data from the theme file/draw some stuff acording to the theme file. Even the custom skinned menus Explorer uses (Win+X, every context menu on the taskbar) still use the blue highlight although there is a bit better represented, as shown above.Anyway, for people that want to revert to the old gray highlight, I recommend using the theme file from previous Windows 11 builds (22000.51, for example). You could also edit the current theme file, but then of course, as you probably know, the digital signature of the file becomes invalid and Windows will refuse to load the theme file unless a uxtheme patcher is used. But the signature is not invalidated when you use a signed file, but from a previous OS version. I prefer this method since I do not use custom themes, I do not want to patch the theme service etc. I basically want the proper stock theme.
2\Windows\resources\Themes\aero\
. In there you will find the requiredaero.msstyles
theme, grab that.C:\Windows\Resources\Themes\aero
. In there, take ownership of the file, rename it to something likeaero_original.msstyles
and paste in the newaero.msstyles
file.Reboot and you should be good to go!
![image](https://user-images.githubusercontent.com/6503598/132145293-845f15ca-8d61-4d99-8008-92cbb4f4dc62.png)
The text was updated successfully, but these errors were encountered: