From aec8c7036fb951880ae9be4040b675bd0855bf1a Mon Sep 17 00:00:00 2001 From: Amrsatrio Date: Wed, 11 Dec 2024 06:39:31 +0700 Subject: [PATCH] GUI: Add option for ep_taskbar in Windows 10 --- ep_gui/GUI.c | 24 +++++++++++++++++++++--- ep_gui/resources/settings.reg | 9 --------- ep_gui/resources/settings10.reg | 8 ++++++++ 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ep_gui/GUI.c b/ep_gui/GUI.c index ade68ad..25e54c5 100644 --- a/ep_gui/GUI.c +++ b/ep_gui/GUI.c @@ -1171,8 +1171,6 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) else if (!_stricmp(funcName, "!IsOldTaskbar") && GUI_GetTaskbarStyle(TRUE) != 0) bSkipLines = TRUE; else if (!_stricmp(funcName, "IsStockWin10Taskbar") && GUI_GetTaskbarStyle(TRUE) != 1) bSkipLines = TRUE; else if (!_stricmp(funcName, "IsAltImplTaskbar") && GUI_GetTaskbarStyle(TRUE) <= 1) bSkipLines = TRUE; - else if (!_stricmp(funcName, "DoesTaskbarDllExist") && !DoesTaskbarDllExist()) bSkipLines = TRUE; - else if (!_stricmp(funcName, "!DoesTaskbarDllExist") && DoesTaskbarDllExist()) bSkipLines = TRUE; else if (!_stricmp(funcName, "!IsStockWindows10TaskbarAvailable") && !(!IsStockWindows10TaskbarAvailable() && GUI_GetTaskbarStyle(FALSE) == 1)) bSkipLines = TRUE; else if (!_stricmp(funcName, "IsWindows10StartMenu") && (!DoesWindows10StartMenuExist() || (dwRes = 0, RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"Start_ShowClassicMode", RRF_RT_DWORD, NULL, &dwRes, &dwSize), (dwRes != 1)))) bSkipLines = TRUE; else if (!_stricmp(funcName, "!IsWindows10StartMenu") && (DoesWindows10StartMenuExist() && (dwRes = 0, RegGetValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"Start_ShowClassicMode", RRF_RT_DWORD, NULL, &dwRes, &dwSize), (dwRes == 1)))) bSkipLines = TRUE; @@ -2516,7 +2514,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) bShouldAlterTaskbarDa = TRUE; } } - if (!wcscmp(name, L"Virtualized_" _T(EP_CLSID) L"_TaskbarPosition") || !wcscmp(name, L"Virtualized_" _T(EP_CLSID) L"_MMTaskbarPosition")) + else if (!wcscmp(name, L"Virtualized_" _T(EP_CLSID) L"_TaskbarPosition") || !wcscmp(name, L"Virtualized_" _T(EP_CLSID) L"_MMTaskbarPosition")) { if (GUI_TaskbarStyle == 0) { @@ -2541,6 +2539,22 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) RemoveMenu(hMenu, 3, MF_BYCOMMAND); } } + else if (!wcscmp(name, L"OldTaskbar")) + { + if (!DoesTaskbarDllExist()) + { + MENUITEMINFOA menuInfo; + ZeroMemory(&menuInfo, sizeof(MENUITEMINFOA)); + menuInfo.cbSize = sizeof(MENUITEMINFOA); + menuInfo.fMask = MIIM_DATA; + GetMenuItemInfoA(hMenu, 3, FALSE, &menuInfo); + if (menuInfo.dwItemData) + { + free(menuInfo.dwItemData); + } + RemoveMenu(hMenu, 3, MF_BYCOMMAND); + } + } HKEY hKey = NULL; wchar_t* matchHKLM = wcsstr(section, L"HKEY_LOCAL_MACHINE"); BOOL bIsHKLM = matchHKLM && (matchHKLM - section) < 3; @@ -2618,6 +2632,10 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) { GUI_TaskbarStyle = value; AdjustTaskbarStyleValue(&GUI_TaskbarStyle); + if (value >= 2 && !DoesTaskbarDllExist()) + { + value = 0; + } } if (hDC && bInvert) { diff --git a/ep_gui/resources/settings.reg b/ep_gui/resources/settings.reg index b40a4fd..ce2937e 100644 --- a/ep_gui/resources/settings.reg +++ b/ep_gui/resources/settings.reg @@ -5,21 +5,12 @@ ;q ;T %R:1001% -;s Taskbar_StyleSection1 DoesTaskbarDllExist [HKEY_CURRENT_USER\Software\ExplorerPatcher] ;z 3 %R:1002% * ;x 0 %R:1003% ;x 1 %R:1004% ;x 2 %R:1047% "OldTaskbar"=dword:00000001 -;g Taskbar_StyleSection1 -;s Taskbar_StyleSection2 !DoesTaskbarDllExist -[HKEY_CURRENT_USER\Software\ExplorerPatcher] -;z 2 %R:1002% * -;x 0 %R:1003% -;x 1 %R:1004% -"OldTaskbar"=dword:00000001 -;g Taskbar_StyleSection2 ;s Taskbar_StockWin10Unavailable !IsStockWindows10TaskbarAvailable ;t ⚠ %R:1049% ;g Taskbar_StockWin10Unavailable diff --git a/ep_gui/resources/settings10.reg b/ep_gui/resources/settings10.reg index d6343e9..acf127f 100644 --- a/ep_gui/resources/settings10.reg +++ b/ep_gui/resources/settings10.reg @@ -6,6 +6,10 @@ ;T %R:1001% [HKEY_CURRENT_USER\Software\ExplorerPatcher] +;z 2 %R:1002% * +;x 0 %R:1404% +;x 2 %R:1047% +"OldTaskbar"=dword:00000000 ;y %R:1005% 🡕 ;ms-settings:taskbar ;y %R:1006% 🡕 @@ -74,6 +78,10 @@ ;x 1 %R:1045% ;x 0 %R:1046% "TaskbarSmallIcons"=dword:00000000 +;s Taskbar_AltImplSection IsAltImplTaskbar +;y %R:1048% +;https://github.com/valinet/ExplorerPatcher/wiki/ExplorerPatcher's-taskbar-implementation +;g Taskbar_AltImplSection ;T %R:1101% [HKEY_CURRENT_USER\Software\ExplorerPatcher]