aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 10:38:21 GMT -8
TASKBOW IS DEAD! LONG LIVE TASKBAND2!
That's right. I've just finished a mod for the default Windows 10 taskbar, which will fix the appearance of the taskbar items. Of course, this is made to be used alongside all the other classic theme mitigations for the taskbar, but it's great! Preview: Mod code: // ==WindhawkMod== // @id classic-taskbar-fix // @name Classic Taskbar Fix // @description Fixes the taskbar items in classic theme // @version 1.1.2 // @author aubymori // @github https://github.com/aubymori // @include explorer.exe // @architecture x86-64 // @compilerOptions -lgdi32 // ==/WindhawkMod==
// ==WindhawkModReadme== /* # Classic Taskbar Fix Fixes the taskbar items in classic theme! */ // ==/WindhawkModReadme==
// ==WindhawkModSettings== /* - xp: false $name: Windows XP style $description: Windows XP handled active taskbar items a bit differently than 2000. Enable this if you want the XP style. */ // ==/WindhawkModSettings==
#include <windhawk_utils.h>
struct { BOOL xp; } settings;
typedef struct tagBUTTONRENDERINFOSTATES { char data[12]; } BUTTONRENDERINFOSTATES, *PBUTTONRENDERINFOSTATES;
/* Remove clock hover effect */ typedef void (* GDIHelpers_FillRectARGB_t)(HDC, LPCRECT, BYTE, DWORD, bool); GDIHelpers_FillRectARGB_t GDIHelpers_FillRectARGB_orig; void __cdecl GDIHelpers_FillRectARGB_hook( HDC hDC, LPCRECT lprc, BYTE btUnknown, DWORD dwUnknown, bool bUnknown ) { return; }
/* Draw taskbar item */ typedef void (* CTaskBtnGroup__DrawBar_t)(void *, HDC, void *, void *); CTaskBtnGroup__DrawBar_t CTaskBtnGroup__DrawBar_orig; void __cdecl CTaskBtnGroup__DrawBar_hook( void *pThis, HDC hDC, void *pRenderInfo, PBUTTONRENDERINFOSTATES pRenderStates ) { LPRECT lprcDest = (LPRECT)((char *)pRenderInfo + 4);
UINT uState = DFCS_BUTTONPUSH; if (pRenderStates->data[2]) { uState |= DFCS_CHECKED; } else if (pRenderStates->data[4]) { uState |= DFCS_PUSHED; }
DrawFrameControl( hDC, lprcDest, DFC_BUTTON, uState );
/* If button is pushed in, offset the rect for the icon and text draw */ if (pRenderStates->data[2] || pRenderStates->data[4]) { lprcDest->top++; lprcDest->bottom++; if (settings.xp) { lprcDest->left++; lprcDest->right++; } }
return; }
/* Add spacing between taskbar items */ typedef long (* CTaskBtnGroup_SetLocation_t)(void *, int, int, LPRECT); CTaskBtnGroup_SetLocation_t CTaskBtnGroup_SetLocation_orig; long __cdecl CTaskBtnGroup_SetLocation_hook( void *pThis, int i1, int i2, LPRECT lprc ) { APPBARDATA abd; abd.cbSize = sizeof(APPBARDATA); if (SHAppBarMessage(ABM_GETTASKBARPOS, &abd)) { if (abd.uEdge == ABE_BOTTOM || abd.uEdge == ABE_TOP) { lprc->right -= 2; } }
return CTaskBtnGroup_SetLocation_orig(pThis, i1, i2, lprc); }
void LoadSettings(void) { settings.xp = Wh_GetIntSetting(L"xp"); }
BOOL Wh_ModInit(void) { HMODULE hExplorer = GetModuleHandleW(NULL); LoadSettings();
WindhawkUtils::SYMBOL_HOOK hooks[] = { { { L"void __cdecl GDIHelpers::FillRectARGB(struct HDC__ *,struct tagRECT const *,unsigned char,unsigned long,bool)" }, (void **)&GDIHelpers_FillRectARGB_orig, (void *)GDIHelpers_FillRectARGB_hook, FALSE }, { { L"private: void __cdecl CTaskBtnGroup::_DrawBar(struct HDC__ *,struct BUTTONRENDERINFO const &,struct BUTTONRENDERINFOSTATES const &)" }, (void **)&CTaskBtnGroup__DrawBar_orig, (void *)CTaskBtnGroup__DrawBar_hook, FALSE }, { { L"public: virtual long __cdecl CTaskBtnGroup::SetLocation(int,int,struct tagRECT const *)" }, (void **)&CTaskBtnGroup_SetLocation_orig, (void*)CTaskBtnGroup_SetLocation_hook, FALSE } };
if (!WindhawkUtils::HookSymbols(hExplorer, hooks, ARRAYSIZE(hooks))) { Wh_Log(L"Failed to hook one or more symbol functions"); return FALSE; }
return TRUE; }
void Wh_ModSettingsChanged(void) { LoadSettings(); }
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 10:40:31 GMT -8
P.S.: It will also fix the clock. Previously, it had the Windows 10 hover effect, but I managed to remove that. It was so faint that I'm sure a lot of you never even noticed it! :3
|
|
|
Post by s34642542 on Oct 1, 2023 12:00:33 GMT -8
This is excellent and works really well. Great job and many thanks for making it.
Off-topic somewhat, but there was talk on the boards some time ago about implementing the things that ExplorerPatcher's "Enable advanced mitigations for correct rendering using classic theme" option did, as individual Windhawk mods. I recall there being three things that it does. Did/could anyone do this? I ask because I'd really like to use your new mod instead of RetroBar, but it requires that EP setting to look right, which adds Client Edge to the navigation pane on the left in File Explorer windows and I absolutely hate that (I'm one of those weirdos who actually liked the way the classic theme looked in 7, which didn't have it).
|
|
|
Post by anixx on Oct 1, 2023 12:40:34 GMT -8
WOW! Does it support progress indicators?
Does it look good in other themes?
|
|
|
Post by anixx on Oct 1, 2023 13:07:49 GMT -8
The distance between buttons should be 2px, I think.
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 13:41:29 GMT -8
WOW! Does it support progress indicators?
Does it look good in other themes?
1. No. I explicitly removed progress indicators since the original taskbar didn't have them. 2. No. It will only look good in classic theme.
As a related sidenote, flashing taskbar items are still rendered in the Windows 10 style, since I have yet to figure out how the text color of taskbar items is set.
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 13:43:05 GMT -8
The distance between buttons should be 2px, I think. I just updated the OP with 1.1.0, which adds the proper spacing. Additionally, there is now an option to toggle between 2000 and XP spacing for active items (XP offsets the text and icon down and right, whereas 2000 only offsets it down).
|
|
|
Post by anixx on Oct 1, 2023 13:47:40 GMT -8
This is excellent and works really well. Great job and many thanks for making it. Off-topic somewhat, but there was talk on the boards some time ago about implementing the things that ExplorerPatcher's "Enable advanced mitigations for correct rendering using classic theme" option did, as individual Windhawk mods. I recall there being three things that it does. Did/could anyone do this? I ask because I'd really like to use your new mod instead of RetroBar, but it requires that EP setting to look right, which adds Client Edge to the navigation pane on the left in File Explorer windows and I absolutely hate that (I'm one of those weirdos who actually liked the way the classic theme looked in 7, which didn't have it). There is already a Windhawk mod doubling the functionality of EP classic theme mitigations. You can comment out the parts you dislike.
|
|
|
Post by anixx on Oct 1, 2023 13:48:51 GMT -8
WOW! Does it support progress indicators?
Does it look good in other themes?
1. No. I explicitly removed progress indicators since the original taskbar didn't have them. Hmmm. I tried to comment out that part but the progress indicators still do not appear...
|
|
|
Post by anixx on Oct 1, 2023 13:52:04 GMT -8
The distance between buttons should be 2px, I think. I just updated the OP with 1.1.0, which adds the proper spacing. Additionally, there is now an option to toggle between 2000 and XP spacing for active items (XP offsets the text and icon down and right, whereas 2000 only offsets it down). I installed the version 1.1.0 but the spacing is still 1px...
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 13:57:19 GMT -8
I just updated the OP with 1.1.0, which adds the proper spacing. Additionally, there is now an option to toggle between 2000 and XP spacing for active items (XP offsets the text and icon down and right, whereas 2000 only offsets it down). I installed the version 1.1.0 but the spacing is still 1px... Restart Explorer.
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 13:58:00 GMT -8
1. No. I explicitly removed progress indicators since the original taskbar didn't have them. Hmmm. I tried to comment out that part but the progress indicators still do not appear... I think then maybe whatever drawing I'm doing is completely overlapping the progress bar. Sorry. :/
|
|
|
Post by anixx on Oct 1, 2023 13:59:56 GMT -8
I installed the version 1.1.0 but the spacing is still 1px... Restart Explorer. Thanks, it works now! The spacing is 3px. Is it the value we had in classic Windows versions? I thought it was 2px (maybe wrong).
|
|
|
Post by anixx on Oct 1, 2023 14:00:46 GMT -8
Hmmm. I tried to comment out that part but the progress indicators still do not appear... I think then maybe whatever drawing I'm doing is completely overlapping the progress bar. Sorry. :/ It seems, the code that removes the progress indicator is thus is not necessary?
|
|
|
Post by anixx on Oct 1, 2023 14:12:22 GMT -8
With added spacing, the taskbar overlaps with tray.
|
|
|
Post by OrthodoxWin32 on Oct 1, 2023 15:44:16 GMT -8
There is already a Windhawk mod doubling the functionality of EP classic theme mitigations. You can comment out the parts you dislike. Precisely, this Windhawks mode still contains this issue, present in the original code : github.com/valinet/ExplorerPatcher/discussions/900It's really annoying if you want to use the classic theme with a Windows 7 style taskbar, without the labels. I tried to modify the mod to correct this problem, and I discovered the responsible section. So, I separated the code into two parts. On the other hand, not activating the part responsible for the bug makes the taskbar less wide, which poses a problem with the board if 16x16 icons are used. Moreover, if this part is not activated you must activate BasicThemer in the background to have a correct result. I advise to activate BasicThemer5, because it is the lightest. classic-theme-explorer.c (33.57 KB) This is not a fix, as there are still display issues, but I imagine it is technically possible to fix this.
|
|
|
Post by OrthodoxWin32 on Oct 1, 2023 15:45:58 GMT -8
Great work aubymori, once again ! Congratulations.
|
|
aubymori
Sophomore Member
👅👅👅👅👅
Posts: 160
OS: Windows 10 IoT Enterprise LTSC 2021
Theme: Windows 10 Default
CPU: Intel Core i5-9300H
RAM: 8GB
GPU: Intel UHD Graphics 630 / NVIDIA GeForce GTX 1650
|
Post by aubymori on Oct 1, 2023 17:56:31 GMT -8
This combination gives correct spacing and does not make the taskbar to overlap the tray: lprc->left +=0; lprc->right +=-1;
(But gets wrong in case of vertical taskbar position)
FWIW You can just remove the top line and replace the bottom line with lprc->right--;
|
|
|
Post by anixx on Oct 1, 2023 22:25:29 GMT -8
The problem is, it becomes stair-like when the taskbar is placed vertically. Should be a check, I think.
|
|
|
Post by anixx on Oct 2, 2023 3:09:53 GMT -8
Okay, here is the check, it seems to work:
RECT rect; HWND taskBar = FindWindow(L"Shell_traywnd", NULL); if(taskBar && GetWindowRect(taskBar, &rect)) { if ((rect.right - rect.left)>(rect.bottom - rect.top)){ lprc->right--; } }
|
|