|
Post by anixx on Feb 4, 2024 8:47:26 GMT -8
In Classic Theme Explorer mod by @cynosphere, with Classic Theme Mitigations, the space to the left of the icons of taskbar buttons increases as the number of the buttons grows, which makes the labels less visible. This bug comes from Explorer Patcher.
The fix is as follows. Change
} else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_SIZINGMARGINS && iPartId == 5 && iStateId == 1) { pMargins->cxLeftWidth = 10; pMargins->cyTopHeight = 10; pMargins->cxRightWidth = 10; pMargins->cyBottomHeight = 10;
to
} else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_SIZINGMARGINS && iPartId == 5 && iStateId == 1) { pMargins->cxLeftWidth = 0; pMargins->cyTopHeight = 10; pMargins->cxRightWidth = 0; pMargins->cyBottomHeight = 10;
Also, please, by all means, submit your mod to the Windhawk repo.
|
|
|
Post by OrthodoxWin32 on Feb 4, 2024 12:23:21 GMT -8
I still have the problem with the taskbar without the labels. I found a temporary solution to the problem, but it's still bad (the icons become too tight, and the taskbar is too narrow). I copy my previous message, and the mod that I modified :
|
|
|
Post by OrthodoxWin32 on Feb 4, 2024 12:38:12 GMT -8
On the other hand, I think that this mod would be more coherent by moving the options relating to the file explorer to another mod (and adding in this other mod the other options relating to the classic theme in file explorer), and by keeping only the options for the taskbar, after merging with the Classic Taskbar Fix mod.
|
|
|
Post by anixx on Feb 4, 2024 13:19:01 GMT -8
On the other hand, I think that this mod would be more coherent by moving the options relating to the file explorer to another mod (and adding in this other mod the other options relating to the classic theme in file explorer), and by keeping only the options for the taskbar, after merging with the Classic Taskbar Fix mod. I agree.
|
|
crumble266
Freshman Member
Posts: 26
OS: Win10 LTSC 2021 (21H2)
CPU: i7-4790
RAM: 32GB
GPU: GTX 1060
|
Post by crumble266 on Feb 5, 2024 7:07:12 GMT -8
good find !
|
|
|
Post by anixx on Feb 7, 2024 13:31:37 GMT -8
On the other hand, I think that this mod would be more coherent by moving the options relating to the file explorer to another mod (and adding in this other mod the other options relating to the classic theme in file explorer), and by keeping only the options for the taskbar, after merging with the Classic Taskbar Fix mod. Try this lightweight mod: {Spoiler}
// ==WindhawkMod== // @id classic-theme-explorer-lite // @name Classic Theme Explorer Lite // @description Classic Theme mitigations for Explorer ported from Explorer Patcher // @version 1.0 // @author Anixx // @github https://github.com/Anixx // @include explorer.exe // @compilerOptions -luxtheme -lgdi32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* Classic theme fixes for Windows 10 taskbar (when running on either Windows 10 or Windows 11) */ // ==/WindhawkModReadme==
#include <uxtheme.h>
using CreateWindowExW_t = decltype(&CreateWindowExW); CreateWindowExW_t CreateWindowExW_Orig; HWND WINAPI CreateWindowExW_Hook(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam) { wchar_t wszClassName[200]; ZeroMemory(wszClassName, 200); if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"TrayNotifyWnd")) { dwExStyle |= WS_EX_STATICEDGE; } if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"NotifyIconOverflowWindow")) { dwExStyle |= WS_EX_STATICEDGE; }
// Disable this block if you don't want 3D borders in folders if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"SysListView32")) { GetClassNameW(GetParent(hWndParent), wszClassName, 200); if (wcscmp(wszClassName, L"Progman")) { dwExStyle |= WS_EX_CLIENTEDGE; } }
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"ReBarWindow32")) { GetClassNameW(hWndParent, wszClassName, 200); if (!wcscmp(wszClassName, L"Shell_TrayWnd")) { dwStyle |= RBS_BANDBORDERS; } }
HWND hWnd = CreateWindowExW_Orig(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam);
return hWnd; } using SetWindowLongPtrW_t = decltype(&SetWindowLongPtrW); SetWindowLongPtrW_t SetWindowLongPtrW_Orig; LONG_PTR SetWindowLongPtrW_Hook(HWND hWnd, int nIndex, LONG_PTR dwNewLong) { WCHAR lpClassName[200]; ZeroMemory(lpClassName, 200); GetClassNameW(hWnd, lpClassName, 200); HWND hWndParent = GetParent(hWnd);
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"TrayNotifyWnd")) { if (nIndex == GWL_EXSTYLE) { dwNewLong |= WS_EX_STATICEDGE; } } if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"NotifyIconOverflowWindow")) { if (nIndex == GWL_EXSTYLE) { dwNewLong |= WS_EX_STATICEDGE; } }
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"ReBarWindow32")) { wchar_t wszClassName[200]; ZeroMemory(wszClassName, 200); GetClassNameW(hWndParent, wszClassName, 200); if (!wcscmp(wszClassName, L"Shell_TrayWnd")) { if (nIndex == GWL_STYLE) { dwNewLong |= RBS_BANDBORDERS; } } }
return SetWindowLongPtrW_Orig(hWnd, nIndex, dwNewLong); }
HTHEME(*pOriginalOpenThemeDataForDpi)(HWND hWnd, LPCWSTR pszClassList, UINT dpi); HTHEME OpenThemeDataForDpiHook(HWND hWnd, LPCWSTR pszClassList, UINT dpi) { if ( (*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"Taskband2")) { return (HTHEME)0xDEADBEEF; } else if ( (*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"TrayNotifyFlyout")) { return (HTHEME)0xDEADBEFF; }
return pOriginalOpenThemeDataForDpi(hWnd, pszClassList, dpi); }
HRESULT(*pOriginalGetThemeMetric)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal); HRESULT GetThemeMetricHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal) {
const int TMT_WIDTH = 2416; const int TMT_HEIGHT = 2417; if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_WIDTH && iPartId == 3 && iStateId == 0) { *piVal = GetSystemMetrics(SM_CXICON); } else if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_HEIGHT && iPartId == 3 && iStateId == 0) { *piVal = GetSystemMetrics(SM_CYICON); } return S_OK; }
HRESULT(*pOriginalGetThemeMargins)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPCRECT prc, MARGINS* pMargins); HRESULT GetThemeMarginsHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPCRECT prc, MARGINS* pMargins) {
const int TMT_SIZINGMARGINS = 3601; const int TMT_CONTENTMARGINS = 3602; HRESULT hr = S_OK; if (hTheme) { hr = pOriginalGetThemeMargins( hTheme, hdc, iPartId, iStateId, iPropId, prc, pMargins ); }
if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_CONTENTMARGINS && iPartId == 5 && iStateId == 1) { // task list button measurements pMargins->cxLeftWidth = 4; pMargins->cyTopHeight = 3; pMargins->cxRightWidth = 4; pMargins->cyBottomHeight = 3; } else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_CONTENTMARGINS && iPartId == 1 && iStateId == 0) { // task list measurements pMargins->cxLeftWidth = 0; pMargins->cyTopHeight = 0; pMargins->cxRightWidth = 4; pMargins->cyBottomHeight = 0; } else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_SIZINGMARGINS && iPartId == 5 && iStateId == 1) { pMargins->cxLeftWidth = 0; pMargins->cyTopHeight = 10; pMargins->cxRightWidth = 0; pMargins->cyBottomHeight = 10; } else if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_CONTENTMARGINS && iPartId == 3 && iStateId == 0) { pMargins->cxLeftWidth = 4; // GetSystemMetrics(SM_CXICONSPACING); pMargins->cyTopHeight = 4; // GetSystemMetrics(SM_CYICONSPACING); pMargins->cxRightWidth = 4; //GetSystemMetrics(SM_CXICONSPACING); pMargins->cyBottomHeight = 4; // GetSystemMetrics(SM_CYICONSPACING); }
HWND hShell_TrayWnd = FindWindowEx(NULL, NULL, L"Shell_TrayWnd", NULL); if (hShell_TrayWnd) { LONG dwStyle = 0; dwStyle = GetWindowLongW(hShell_TrayWnd, GWL_STYLE); dwStyle |= WS_DLGFRAME; SetWindowLongW(hShell_TrayWnd, GWL_STYLE, dwStyle); dwStyle &= ~WS_DLGFRAME; SetWindowLongW(hShell_TrayWnd, GWL_STYLE, dwStyle); }
HWND hWnd = NULL; do { hWnd = FindWindowEx( NULL, hWnd, L"Shell_SecondaryTrayWnd", NULL ); if (hWnd) { LONG dwStyle = 0; dwStyle = GetWindowLongW(hWnd, GWL_STYLE); dwStyle |= WS_DLGFRAME; SetWindowLongW(hWnd, GWL_STYLE, dwStyle); dwStyle &= ~WS_DLGFRAME; SetWindowLongW(hWnd, GWL_STYLE, dwStyle); } } while (hWnd);
return S_OK; }
HRESULT(*pOriginalDrawThemeTextEx)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions); HRESULT DrawThemeTextExHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions) {
COLORREF bc = GetBkColor(hdc); COLORREF fc = GetTextColor(hdc); int mode = SetBkMode(hdc, TRANSPARENT);
wchar_t text[200]; GetWindowTextW(GetForegroundWindow(), text, 200);
BOOL bIsActiveUnhovered = (iPartId == 5 && iStateId == 5); BOOL bIsInactiveUnhovered = (iPartId == 5 && iStateId == 1); BOOL bIsInactiveHovered = (iPartId == 5 && iStateId == 2); BOOL bIsActiveHovered = bIsInactiveHovered && !wcscmp(text, pszText);
SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
NONCLIENTMETRICSW ncm; ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0);
HFONT hFont = NULL; if (bIsActiveUnhovered || bIsActiveHovered) { ncm.lfCaptionFont.lfWeight = FW_BOLD; } else { ncm.lfCaptionFont.lfWeight = FW_NORMAL; } hFont = CreateFontIndirectW(&(ncm.lfCaptionFont));
if (iPartId == 5 && iStateId == 0) // clock { pRect->top += 2; }
HGDIOBJ hOldFont = SelectObject(hdc, hFont); DrawTextW( hdc, pszText, cchText, pRect, dwTextFlags ); SelectObject(hdc, hOldFont); DeleteObject(hFont); SetBkColor(hdc, bc); SetTextColor(hdc, fc); SetBkMode(hdc, mode);
return S_OK; }
HRESULT(*pOriginalDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPRECT pRect, LPCRECT pClipRect); HRESULT DrawThemeBackgroundHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPRECT pRect, LPCRECT pClipRect) { if (TRUE) { if (iPartId == 4 && iStateId == 1) { COLORREF bc = GetBkColor(hdc); COLORREF fc = GetTextColor(hdc); int mode = SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
NONCLIENTMETRICSW ncm; ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0);
HFONT hFont = CreateFontIndirectW(&(ncm.lfCaptionFont));
HGDIOBJ hOldFont = SelectObject(hdc, hFont); DWORD dwTextFlags = DT_SINGLELINE | DT_CENTER | DT_VCENTER; RECT rc = *pRect; rc.bottom -= 7; DrawTextW( hdc, L"\u2026", -1, &rc, dwTextFlags ); SelectObject(hdc, hOldFont); DeleteObject(hFont); SetBkColor(hdc, bc); SetTextColor(hdc, fc); SetBkMode(hdc, mode); } return S_OK; }
return pOriginalDrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); }
BOOL Wh_ModInit() {
HMODULE hUxtheme = GetModuleHandle(L"uxtheme.dll");
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "OpenThemeDataForDpi"), (void*)OpenThemeDataForDpiHook, (void**)&pOriginalOpenThemeDataForDpi); Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "GetThemeMetric"), (void*)GetThemeMetricHook, (void**)&pOriginalGetThemeMetric); Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "GetThemeMargins"), (void*)GetThemeMarginsHook, (void**)&pOriginalGetThemeMargins);
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "DrawThemeTextEx"), (void*)DrawThemeTextExHook, (void**)&pOriginalDrawThemeTextEx);
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "DrawThemeBackground"), (void*)DrawThemeBackgroundHook, (void**)&pOriginalDrawThemeBackground);
Wh_SetFunctionHook((void*)CreateWindowExW, (void*)CreateWindowExW_Hook, (void**)&CreateWindowExW_Orig); Wh_SetFunctionHook((void*)SetWindowLongPtrW, (void*)SetWindowLongPtrW_Hook, (void**)&SetWindowLongPtrW_Orig);
return TRUE; }
|
|
|
Post by OrthodoxWin32 on Feb 7, 2024 16:03:59 GMT -8
Try this lightweight mod: {Spoiler}
// ==WindhawkMod== // @id classic-theme-explorer-lite // @name Classic Theme Explorer Lite // @description Classic Theme mitigations for Explorer ported from Explorer Patcher // @version 1.0 // @author Anixx // @github https://github.com/Anixx // @include explorer.exe // @compilerOptions -luxtheme -lgdi32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* Classic theme fixes for Windows 10 taskbar (when running on either Windows 10 or Windows 11) */ // ==/WindhawkModReadme==
#include <uxtheme.h>
using CreateWindowExW_t = decltype(&CreateWindowExW); CreateWindowExW_t CreateWindowExW_Orig; HWND WINAPI CreateWindowExW_Hook(DWORD dwExStyle,LPCWSTR lpClassName,LPCWSTR lpWindowName,DWORD dwStyle,int X,int Y,int nWidth,int nHeight,HWND hWndParent,HMENU hMenu,HINSTANCE hInstance,LPVOID lpParam) { wchar_t wszClassName[200]; ZeroMemory(wszClassName, 200); if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"TrayNotifyWnd")) { dwExStyle |= WS_EX_STATICEDGE; } if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"NotifyIconOverflowWindow")) { dwExStyle |= WS_EX_STATICEDGE; }
// Disable this block if you don't want 3D borders in folders if ((*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"SysListView32")) { GetClassNameW(GetParent(hWndParent), wszClassName, 200); if (wcscmp(wszClassName, L"Progman")) { dwExStyle |= WS_EX_CLIENTEDGE; } }
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"ReBarWindow32")) { GetClassNameW(hWndParent, wszClassName, 200); if (!wcscmp(wszClassName, L"Shell_TrayWnd")) { dwStyle |= RBS_BANDBORDERS; } }
HWND hWnd = CreateWindowExW_Orig(dwExStyle,lpClassName,lpWindowName,dwStyle,X,Y,nWidth,nHeight,hWndParent,hMenu,hInstance,lpParam);
return hWnd; } using SetWindowLongPtrW_t = decltype(&SetWindowLongPtrW); SetWindowLongPtrW_t SetWindowLongPtrW_Orig; LONG_PTR SetWindowLongPtrW_Hook(HWND hWnd, int nIndex, LONG_PTR dwNewLong) { WCHAR lpClassName[200]; ZeroMemory(lpClassName, 200); GetClassNameW(hWnd, lpClassName, 200); HWND hWndParent = GetParent(hWnd);
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"TrayNotifyWnd")) { if (nIndex == GWL_EXSTYLE) { dwNewLong |= WS_EX_STATICEDGE; } } if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"NotifyIconOverflowWindow")) { if (nIndex == GWL_EXSTYLE) { dwNewLong |= WS_EX_STATICEDGE; } }
if ( (*((WORD*)&(lpClassName)+1)) && !wcscmp(lpClassName, L"ReBarWindow32")) { wchar_t wszClassName[200]; ZeroMemory(wszClassName, 200); GetClassNameW(hWndParent, wszClassName, 200); if (!wcscmp(wszClassName, L"Shell_TrayWnd")) { if (nIndex == GWL_STYLE) { dwNewLong |= RBS_BANDBORDERS; } } }
return SetWindowLongPtrW_Orig(hWnd, nIndex, dwNewLong); }
HTHEME(*pOriginalOpenThemeDataForDpi)(HWND hWnd, LPCWSTR pszClassList, UINT dpi); HTHEME OpenThemeDataForDpiHook(HWND hWnd, LPCWSTR pszClassList, UINT dpi) { if ( (*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"Taskband2")) { return (HTHEME)0xDEADBEEF; } else if ( (*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"TrayNotifyFlyout")) { return (HTHEME)0xDEADBEFF; }
return pOriginalOpenThemeDataForDpi(hWnd, pszClassList, dpi); }
HRESULT(*pOriginalGetThemeMetric)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal); HRESULT GetThemeMetricHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, int* piVal) {
const int TMT_WIDTH = 2416; const int TMT_HEIGHT = 2417; if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_WIDTH && iPartId == 3 && iStateId == 0) { *piVal = GetSystemMetrics(SM_CXICON); } else if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_HEIGHT && iPartId == 3 && iStateId == 0) { *piVal = GetSystemMetrics(SM_CYICON); } return S_OK; }
HRESULT(*pOriginalGetThemeMargins)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPCRECT prc, MARGINS* pMargins); HRESULT GetThemeMarginsHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, LPCRECT prc, MARGINS* pMargins) {
const int TMT_SIZINGMARGINS = 3601; const int TMT_CONTENTMARGINS = 3602; HRESULT hr = S_OK; if (hTheme) { hr = pOriginalGetThemeMargins( hTheme, hdc, iPartId, iStateId, iPropId, prc, pMargins ); }
if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_CONTENTMARGINS && iPartId == 5 && iStateId == 1) { // task list button measurements pMargins->cxLeftWidth = 4; pMargins->cyTopHeight = 3; pMargins->cxRightWidth = 4; pMargins->cyBottomHeight = 3; } else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_CONTENTMARGINS && iPartId == 1 && iStateId == 0) { // task list measurements pMargins->cxLeftWidth = 0; pMargins->cyTopHeight = 0; pMargins->cxRightWidth = 4; pMargins->cyBottomHeight = 0; } else if (hTheme == (HTHEME)0xDEADBEEF && iPropId == TMT_SIZINGMARGINS && iPartId == 5 && iStateId == 1) { pMargins->cxLeftWidth = 0; pMargins->cyTopHeight = 10; pMargins->cxRightWidth = 0; pMargins->cyBottomHeight = 10; } else if (hTheme == (HTHEME)0xDEADBEFF && iPropId == TMT_CONTENTMARGINS && iPartId == 3 && iStateId == 0) { pMargins->cxLeftWidth = 4; // GetSystemMetrics(SM_CXICONSPACING); pMargins->cyTopHeight = 4; // GetSystemMetrics(SM_CYICONSPACING); pMargins->cxRightWidth = 4; //GetSystemMetrics(SM_CXICONSPACING); pMargins->cyBottomHeight = 4; // GetSystemMetrics(SM_CYICONSPACING); }
HWND hShell_TrayWnd = FindWindowEx(NULL, NULL, L"Shell_TrayWnd", NULL); if (hShell_TrayWnd) { LONG dwStyle = 0; dwStyle = GetWindowLongW(hShell_TrayWnd, GWL_STYLE); dwStyle |= WS_DLGFRAME; SetWindowLongW(hShell_TrayWnd, GWL_STYLE, dwStyle); dwStyle &= ~WS_DLGFRAME; SetWindowLongW(hShell_TrayWnd, GWL_STYLE, dwStyle); }
HWND hWnd = NULL; do { hWnd = FindWindowEx( NULL, hWnd, L"Shell_SecondaryTrayWnd", NULL ); if (hWnd) { LONG dwStyle = 0; dwStyle = GetWindowLongW(hWnd, GWL_STYLE); dwStyle |= WS_DLGFRAME; SetWindowLongW(hWnd, GWL_STYLE, dwStyle); dwStyle &= ~WS_DLGFRAME; SetWindowLongW(hWnd, GWL_STYLE, dwStyle); } } while (hWnd);
return S_OK; }
HRESULT(*pOriginalDrawThemeTextEx)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions); HRESULT DrawThemeTextExHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, LPRECT pRect, const DTTOPTS* pOptions) {
COLORREF bc = GetBkColor(hdc); COLORREF fc = GetTextColor(hdc); int mode = SetBkMode(hdc, TRANSPARENT);
wchar_t text[200]; GetWindowTextW(GetForegroundWindow(), text, 200);
BOOL bIsActiveUnhovered = (iPartId == 5 && iStateId == 5); BOOL bIsInactiveUnhovered = (iPartId == 5 && iStateId == 1); BOOL bIsInactiveHovered = (iPartId == 5 && iStateId == 2); BOOL bIsActiveHovered = bIsInactiveHovered && !wcscmp(text, pszText);
SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
NONCLIENTMETRICSW ncm; ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0);
HFONT hFont = NULL; if (bIsActiveUnhovered || bIsActiveHovered) { ncm.lfCaptionFont.lfWeight = FW_BOLD; } else { ncm.lfCaptionFont.lfWeight = FW_NORMAL; } hFont = CreateFontIndirectW(&(ncm.lfCaptionFont));
if (iPartId == 5 && iStateId == 0) // clock { pRect->top += 2; }
HGDIOBJ hOldFont = SelectObject(hdc, hFont); DrawTextW( hdc, pszText, cchText, pRect, dwTextFlags ); SelectObject(hdc, hOldFont); DeleteObject(hFont); SetBkColor(hdc, bc); SetTextColor(hdc, fc); SetBkMode(hdc, mode);
return S_OK; }
HRESULT(*pOriginalDrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPRECT pRect, LPCRECT pClipRect); HRESULT DrawThemeBackgroundHook(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPRECT pRect, LPCRECT pClipRect) { if (TRUE) { if (iPartId == 4 && iStateId == 1) { COLORREF bc = GetBkColor(hdc); COLORREF fc = GetTextColor(hdc); int mode = SetBkMode(hdc, TRANSPARENT);
SetTextColor(hdc, GetSysColor(COLOR_BTNTEXT));
NONCLIENTMETRICSW ncm; ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0);
HFONT hFont = CreateFontIndirectW(&(ncm.lfCaptionFont));
HGDIOBJ hOldFont = SelectObject(hdc, hFont); DWORD dwTextFlags = DT_SINGLELINE | DT_CENTER | DT_VCENTER; RECT rc = *pRect; rc.bottom -= 7; DrawTextW( hdc, L"\u2026", -1, &rc, dwTextFlags ); SelectObject(hdc, hOldFont); DeleteObject(hFont); SetBkColor(hdc, bc); SetTextColor(hdc, fc); SetBkMode(hdc, mode); } return S_OK; }
return pOriginalDrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); }
BOOL Wh_ModInit() {
HMODULE hUxtheme = GetModuleHandle(L"uxtheme.dll");
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "OpenThemeDataForDpi"), (void*)OpenThemeDataForDpiHook, (void**)&pOriginalOpenThemeDataForDpi); Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "GetThemeMetric"), (void*)GetThemeMetricHook, (void**)&pOriginalGetThemeMetric); Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "GetThemeMargins"), (void*)GetThemeMarginsHook, (void**)&pOriginalGetThemeMargins);
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "DrawThemeTextEx"), (void*)DrawThemeTextExHook, (void**)&pOriginalDrawThemeTextEx);
Wh_SetFunctionHook((void*)GetProcAddress(hUxtheme, "DrawThemeBackground"), (void*)DrawThemeBackgroundHook, (void**)&pOriginalDrawThemeBackground);
Wh_SetFunctionHook((void*)CreateWindowExW, (void*)CreateWindowExW_Hook, (void**)&CreateWindowExW_Orig); Wh_SetFunctionHook((void*)SetWindowLongPtrW, (void*)SetWindowLongPtrW_Hook, (void**)&SetWindowLongPtrW_Orig);
return TRUE; }
Well done, this mod is almost perfect ! It's absolutely great.
The ideal would perhaps be to add an option to choose whether the clientedge is displayed in the explorer (I use the clientedge in file explorer, but it seems to me that some users do not like it).
|
|
|
Post by anixx on Feb 7, 2024 23:57:16 GMT -8
Well done, this mod is almost perfect ! It's absolutely great.
The ideal would perhaps be to add an option to choose whether the clientedge is displayed in the explorer (I use the clientedge in file explorer, but it seems to me that some users do not like it).
In the code look up the comment "// Disable this block if you don't want 3D borders in folders". If you comment out the next block, the ClientEdge will not be displayed.
|
|
|
Post by anixx on Feb 8, 2024 0:59:34 GMT -8
|
|
|
Post by OrthodoxWin32 on Feb 8, 2024 1:23:21 GMT -8
My apologies, I had reactivated the old mod by mistake, which had reactivated the bug that was associated with it.
|
|
crumble266
Freshman Member
Posts: 26
OS: Win10 LTSC 2021 (21H2)
CPU: i7-4790
RAM: 32GB
GPU: GTX 1060
|
Post by crumble266 on Feb 13, 2024 9:04:13 GMT -8
Is there a way to change quick launch icons' vertical spacing/padding? When using two rows, the taskbar has different heights depending on the Windows version. What appears to be different is the vertical padding of the first row.
|
|
|
Post by anixx on Feb 14, 2024 23:28:21 GMT -8
This fix has been merged to EP.
|
|
|
Post by OrthodoxWin32 on Feb 17, 2024 4:37:23 GMT -8
When logging in, the taskbar regularly (but not every time) appears black :
After restarting Explorer, the problem disappears. I think the problem is related to starting OpenShell at a different time than the ClassicExplorer mod.
|
|
|
Post by anixx on Feb 17, 2024 4:53:55 GMT -8
When logging in, the taskbar regularly (but not every time) appears black :
After restarting Explorer, the problem disappears. I think the problem is related to starting OpenShell at a different time than the ClassicExplorer mod.
I do not experience this issue. Are Classic Theme Mitigations enabled in EP? It can conflict with the Windhawk mod.
|
|
|
Post by OrthodoxWin32 on Feb 17, 2024 4:56:30 GMT -8
I do not experience this issue. Are Classic Theme Mitigations enabled in EP? It can conflict with the Windhawk mod. No the Classic Theme Mitigations it's disabled in EP. But we may not be using the same version of OpenShell (I use 4.4.190).
|
|
|
Post by anixx on Feb 17, 2024 5:04:33 GMT -8
I do not experience this issue. Are Classic Theme Mitigations enabled in EP? It can conflict with the Windhawk mod. No the Classic Theme Mitigations it's disabled in EP. But we may not be using the same version of OpenShell (I use 4.4.190). If you have the Classic Theme Mitigations enabled in EP and in Windhawk, they can conflict with each other.
|
|
|
Post by OrthodoxWin32 on Feb 17, 2024 5:13:28 GMT -8
If you have the Classic Theme Mitigations enabled in EP and in Windhawk, they can conflict with each other. In my case it is only activated in Windhawk. I will continue to look for the origin of the issue.
|
|
clara
Sophomore Member
Posts: 118
|
Post by clara on Feb 22, 2024 23:10:37 GMT -8
Didn't know where to post this, but i think this place is thread enough, since it's EP mitigations related.
I have noticed, that one instance of EP mitigations enabled won't draw toolbar separators on the taskbar, however, having both Classic Theme Explorer and mitigations in EP enabled simultaneously, they will appear. Interestingly, the toolbar separator after the Start button never appears, so I'm curious: is this related to EP, Classic Taskbar mod or Open-Shell, perhaps and how hard will it be to make toolbar separators appear after Start button?
|
|
crumble266
Freshman Member
Posts: 26
OS: Win10 LTSC 2021 (21H2)
CPU: i7-4790
RAM: 32GB
GPU: GTX 1060
|
Post by crumble266 on Feb 23, 2024 7:30:19 GMT -8
In classic-theme-explorer-lite, could you add an option to disable the taskbar separators ? (lines 81-93)
|
|
|
Post by anixx on Feb 23, 2024 8:39:28 GMT -8
In classic-theme-explorer-lite, could you add an option to disable the taskbar separators ? (lines 81-93) What separators do you mean? By default there are no separators.
|
|