|
|
|
@ -104,7 +104,12 @@ void WINAPI Explorer_RefreshUI(int unused); |
|
|
|
|
|
|
|
|
|
|
|
#define ORB_STYLE_WINDOWS10 0 |
|
|
|
#define ORB_STYLE_WINDOWS10 0 |
|
|
|
#define ORB_STYLE_WINDOWS11 1 |
|
|
|
#define ORB_STYLE_WINDOWS11 1 |
|
|
|
#define ORB_WINDOWS11_SEPARATOR 1 |
|
|
|
#define ORB_STYLE_TRANSPARENT 2 |
|
|
|
|
|
|
|
typedef struct _OrbInfo |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
HTHEME hTheme; |
|
|
|
|
|
|
|
UINT dpi; |
|
|
|
|
|
|
|
} OrbInfo; |
|
|
|
|
|
|
|
|
|
|
|
void* P_Icon_Light_Search = NULL; |
|
|
|
void* P_Icon_Light_Search = NULL; |
|
|
|
DWORD S_Icon_Light_Search = 0; |
|
|
|
DWORD S_Icon_Light_Search = 0; |
|
|
|
@ -3934,11 +3939,14 @@ DWORD WindowSwitcher(DWORD unused) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#pragma region "Load Settings from registry" |
|
|
|
#pragma region "Load Settings from registry" |
|
|
|
|
|
|
|
#define REFRESHUI_NONE 0b00 |
|
|
|
|
|
|
|
#define REFRESHUI_GLOM 0b01 |
|
|
|
|
|
|
|
#define REFRESHUI_ORB 0b10 |
|
|
|
void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
{ |
|
|
|
{ |
|
|
|
BOOL bIsExplorer = LOWORD(lParam); |
|
|
|
BOOL bIsExplorer = LOWORD(lParam); |
|
|
|
BOOL bIsRefreshAllowed = HIWORD(lParam); |
|
|
|
BOOL bIsRefreshAllowed = HIWORD(lParam); |
|
|
|
BOOL bShouldRefreshUI = FALSE; |
|
|
|
DWORD dwRefreshUIMask = REFRESHUI_NONE; |
|
|
|
|
|
|
|
|
|
|
|
HKEY hKey = NULL; |
|
|
|
HKEY hKey = NULL; |
|
|
|
DWORD dwSize = 0, dwTemp = 0; |
|
|
|
DWORD dwSize = 0, dwTemp = 0; |
|
|
|
@ -4385,15 +4393,21 @@ void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
&bTaskbarAutohideOnDoubleClick, |
|
|
|
&bTaskbarAutohideOnDoubleClick, |
|
|
|
&dwSize |
|
|
|
&dwSize |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
dwTemp = ORB_STYLE_WINDOWS10; |
|
|
|
dwSize = sizeof(DWORD); |
|
|
|
dwSize = sizeof(DWORD); |
|
|
|
RegQueryValueExW( |
|
|
|
RegQueryValueExW( |
|
|
|
hKey, |
|
|
|
hKey, |
|
|
|
TEXT("OrbStyle"), |
|
|
|
TEXT("OrbStyle"), |
|
|
|
0, |
|
|
|
0, |
|
|
|
NULL, |
|
|
|
NULL, |
|
|
|
&dwOrbStyle, |
|
|
|
&dwTemp, |
|
|
|
&dwSize |
|
|
|
&dwSize |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
if (bOldTaskbar && (dwTemp != dwOrbStyle)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
dwOrbStyle = dwTemp; |
|
|
|
|
|
|
|
dwRefreshUIMask |= REFRESHUI_ORB; |
|
|
|
|
|
|
|
} |
|
|
|
dwSize = sizeof(DWORD); |
|
|
|
dwSize = sizeof(DWORD); |
|
|
|
RegQueryValueExW( |
|
|
|
RegQueryValueExW( |
|
|
|
hKey, |
|
|
|
hKey, |
|
|
|
@ -4456,9 +4470,9 @@ void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
&dwTemp, |
|
|
|
&dwTemp, |
|
|
|
&dwSize |
|
|
|
&dwSize |
|
|
|
); |
|
|
|
); |
|
|
|
if (dwTemp != dwTaskbarGlomLevel) |
|
|
|
if (bOldTaskbar && (dwTemp != dwTaskbarGlomLevel)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bShouldRefreshUI = TRUE; |
|
|
|
dwRefreshUIMask = REFRESHUI_GLOM; |
|
|
|
} |
|
|
|
} |
|
|
|
dwTaskbarGlomLevel = dwTemp; |
|
|
|
dwTaskbarGlomLevel = dwTemp; |
|
|
|
dwTemp = MMTASKBARGLOMLEVEL_DEFAULT; |
|
|
|
dwTemp = MMTASKBARGLOMLEVEL_DEFAULT; |
|
|
|
@ -4471,9 +4485,9 @@ void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
&dwTemp, |
|
|
|
&dwTemp, |
|
|
|
&dwSize |
|
|
|
&dwSize |
|
|
|
); |
|
|
|
); |
|
|
|
if (dwTemp != dwMMTaskbarGlomLevel) |
|
|
|
if (bOldTaskbar && (dwTemp != dwMMTaskbarGlomLevel)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
bShouldRefreshUI = TRUE; |
|
|
|
dwRefreshUIMask = REFRESHUI_GLOM; |
|
|
|
} |
|
|
|
} |
|
|
|
dwMMTaskbarGlomLevel = dwTemp; |
|
|
|
dwMMTaskbarGlomLevel = dwTemp; |
|
|
|
RegCloseKey(hKey); |
|
|
|
RegCloseKey(hKey); |
|
|
|
@ -4667,10 +4681,21 @@ void WINAPI LoadSettings(LPARAM lParam) |
|
|
|
RegCloseKey(hKey); |
|
|
|
RegCloseKey(hKey); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (bIsRefreshAllowed && bShouldRefreshUI) |
|
|
|
if (bIsRefreshAllowed && dwRefreshUIMask) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (dwRefreshUIMask & REFRESHUI_GLOM) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Explorer_RefreshUI(0); |
|
|
|
Explorer_RefreshUI(0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (dwRefreshUIMask & REFRESHUI_ORB) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
#ifdef _WIN64 |
|
|
|
|
|
|
|
ToggleTaskbarAutohide(); |
|
|
|
|
|
|
|
ToggleTaskbarAutohide(); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
InvalidateRect(FindWindowW(L"ExplorerPatcher_GUI_" _T(EP_CLSID), NULL), NULL, FALSE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void Explorer_RefreshClockHelper(HWND hClockButton) |
|
|
|
void Explorer_RefreshClockHelper(HWND hClockButton) |
|
|
|
@ -4943,7 +4968,16 @@ HRESULT explorer_SetWindowThemeHook( |
|
|
|
return explorer_SetWindowThemeFunc(hwnd, pszSubAppName, pszSubIdList); |
|
|
|
return explorer_SetWindowThemeFunc(hwnd, pszSubAppName, pszSubIdList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HTHEME hStartOrbTheme = NULL; |
|
|
|
INT64 explorer_SetWindowCompositionAttribute(HWND hWnd, WINCOMPATTRDATA* data) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (bClassicThemeMitigations) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return SetWindowCompositionAttribute(hWnd, data); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HDPA hOrbCollection = NULL; |
|
|
|
HRESULT explorer_DrawThemeBackground( |
|
|
|
HRESULT explorer_DrawThemeBackground( |
|
|
|
HTHEME hTheme, |
|
|
|
HTHEME hTheme, |
|
|
|
HDC hdc, |
|
|
|
HDC hdc, |
|
|
|
@ -4953,7 +4987,12 @@ HRESULT explorer_DrawThemeBackground( |
|
|
|
LPCRECT pClipRect |
|
|
|
LPCRECT pClipRect |
|
|
|
) |
|
|
|
) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (dwOrbStyle == ORB_STYLE_WINDOWS11 && hStartOrbTheme == hTheme) |
|
|
|
if (dwOrbStyle && hOrbCollection) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
for (unsigned int i = 0; i < DPA_GetPtrCount(hOrbCollection); ++i) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
OrbInfo* oi = DPA_FastGetPtr(hOrbCollection, i); |
|
|
|
|
|
|
|
if (oi->hTheme == hTheme) |
|
|
|
{ |
|
|
|
{ |
|
|
|
BITMAPINFO bi; |
|
|
|
BITMAPINFO bi; |
|
|
|
ZeroMemory(&bi, sizeof(BITMAPINFO)); |
|
|
|
ZeroMemory(&bi, sizeof(BITMAPINFO)); |
|
|
|
@ -4966,30 +5005,50 @@ HRESULT explorer_DrawThemeBackground( |
|
|
|
RGBQUAD transparent = { 0, 0, 0, 0 }; |
|
|
|
RGBQUAD transparent = { 0, 0, 0, 0 }; |
|
|
|
RGBQUAD color = { 0xFF, 0xFF, 0xFF, 0xFF }; |
|
|
|
RGBQUAD color = { 0xFF, 0xFF, 0xFF, 0xFF }; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (dwOrbStyle == ORB_STYLE_WINDOWS11) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
UINT separator = oi->dpi / 96; |
|
|
|
|
|
|
|
//printf(">>> SEPARATOR %p %d %d\n", oi->hTheme, oi->dpi, separator);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Background
|
|
|
|
StretchDIBits(hdc, |
|
|
|
StretchDIBits(hdc, |
|
|
|
pRect->left, |
|
|
|
pRect->left + (separator % 2), |
|
|
|
pRect->top, |
|
|
|
pRect->top + (separator % 2), |
|
|
|
pRect->right - pRect->left, |
|
|
|
pRect->right - pRect->left - (separator % 2), |
|
|
|
pRect->bottom - pRect->top, |
|
|
|
pRect->bottom - pRect->top - (separator % 2), |
|
|
|
0, 0, 1, 1, &color, &bi, |
|
|
|
0, 0, 1, 1, &color, &bi, |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
|
|
|
|
// Middle vertical line
|
|
|
|
StretchDIBits(hdc, |
|
|
|
StretchDIBits(hdc, |
|
|
|
pRect->left + ((pRect->right - pRect->left) / 2) - ORB_WINDOWS11_SEPARATOR / 2, |
|
|
|
pRect->left + ((pRect->right - pRect->left) / 2) - (separator / 2), |
|
|
|
pRect->top, |
|
|
|
pRect->top, |
|
|
|
ORB_WINDOWS11_SEPARATOR, |
|
|
|
separator, |
|
|
|
pRect->bottom - pRect->top, |
|
|
|
pRect->bottom - pRect->top, |
|
|
|
0, 0, 1, 1, &transparent, &bi, |
|
|
|
0, 0, 1, 1, &transparent, &bi, |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
|
|
|
|
// Middle horizontal line
|
|
|
|
StretchDIBits(hdc, |
|
|
|
StretchDIBits(hdc, |
|
|
|
pRect->left, |
|
|
|
pRect->left, |
|
|
|
pRect->top + ((pRect->bottom - pRect->top) / 2) - ORB_WINDOWS11_SEPARATOR / 2, |
|
|
|
pRect->top + ((pRect->bottom - pRect->top) / 2) - (separator / 2), |
|
|
|
pRect->right - pRect->left, |
|
|
|
pRect->right - pRect->left, |
|
|
|
ORB_WINDOWS11_SEPARATOR, |
|
|
|
separator, |
|
|
|
0, 0, 1, 1, &transparent, &bi, |
|
|
|
0, 0, 1, 1, &transparent, &bi, |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else if (dwOrbStyle == ORB_STYLE_TRANSPARENT) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
StretchDIBits(hdc, |
|
|
|
|
|
|
|
pRect->left, |
|
|
|
|
|
|
|
pRect->top, |
|
|
|
|
|
|
|
pRect->right - pRect->left, |
|
|
|
|
|
|
|
pRect->bottom - pRect->top, |
|
|
|
|
|
|
|
0, 0, 1, 1, &transparent, &bi, |
|
|
|
|
|
|
|
DIB_RGB_COLORS, SRCCOPY); |
|
|
|
|
|
|
|
} |
|
|
|
return S_OK; |
|
|
|
return S_OK; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (bClassicThemeMitigations) |
|
|
|
if (bClassicThemeMitigations) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (iPartId == 4 && iStateId == 1) |
|
|
|
if (iPartId == 4 && iStateId == 1) |
|
|
|
@ -5037,13 +5096,24 @@ HRESULT explorer_DrawThemeBackground( |
|
|
|
return DrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); |
|
|
|
return DrawThemeBackground(hTheme, hdc, iPartId, iStateId, pRect, pClipRect); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
INT64 explorer_SetWindowCompositionAttribute(HWND hWnd, WINCOMPATTRDATA* data) |
|
|
|
HRESULT explorer_CloseThemeData(HTHEME hTheme) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (bClassicThemeMitigations) |
|
|
|
HRESULT hr = CloseThemeData(hTheme); |
|
|
|
|
|
|
|
if (SUCCEEDED(hr) && hOrbCollection) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return TRUE; |
|
|
|
for (unsigned int i = 0; i < DPA_GetPtrCount(hOrbCollection); ++i) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
OrbInfo* oi = DPA_FastGetPtr(hOrbCollection, i); |
|
|
|
|
|
|
|
if (oi->hTheme == hTheme) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
//printf(">>> DELETE DPA %p %d\n", oi->hTheme, oi->dpi);
|
|
|
|
|
|
|
|
DPA_DeletePtr(hOrbCollection, i); |
|
|
|
|
|
|
|
free(oi); |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return SetWindowCompositionAttribute(hWnd, data); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return hr; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HTHEME explorer_OpenThemeDataForDpi( |
|
|
|
HTHEME explorer_OpenThemeDataForDpi( |
|
|
|
@ -5052,12 +5122,24 @@ HTHEME explorer_OpenThemeDataForDpi( |
|
|
|
UINT dpi |
|
|
|
UINT dpi |
|
|
|
) |
|
|
|
) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (dwOrbStyle == ORB_STYLE_WINDOWS11 && (*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"TaskbarPearl")) |
|
|
|
if ((*((WORD*)&(pszClassList)+1)) && !wcscmp(pszClassList, L"TaskbarPearl")) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!hOrbCollection) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
hOrbCollection = DPA_Create(MAX_NUM_MONITORS); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HTHEME hTheme = OpenThemeDataForDpi(hwnd, pszClassList, dpi); |
|
|
|
HTHEME hTheme = OpenThemeDataForDpi(hwnd, pszClassList, dpi); |
|
|
|
if (hTheme) |
|
|
|
if (hTheme && hOrbCollection) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
OrbInfo* oi = malloc(sizeof(OrbInfo)); |
|
|
|
|
|
|
|
if (oi) |
|
|
|
{ |
|
|
|
{ |
|
|
|
hStartOrbTheme = hTheme; |
|
|
|
oi->hTheme = hTheme; |
|
|
|
|
|
|
|
oi->dpi = dpi; |
|
|
|
|
|
|
|
//printf(">>> APPEND DPA %p %d\n", oi->hTheme, oi->dpi);
|
|
|
|
|
|
|
|
DPA_AppendPtr(hOrbCollection, oi); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return hTheme; |
|
|
|
return hTheme; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -6499,6 +6581,7 @@ DWORD Inject(BOOL bIsExplorer) |
|
|
|
VnPatchIAT(hExplorer, "user32.dll", "TrackPopupMenuEx", explorer_TrackPopupMenuExHook); |
|
|
|
VnPatchIAT(hExplorer, "user32.dll", "TrackPopupMenuEx", explorer_TrackPopupMenuExHook); |
|
|
|
VnPatchIAT(hExplorer, "uxtheme.dll", "OpenThemeDataForDpi", explorer_OpenThemeDataForDpi); |
|
|
|
VnPatchIAT(hExplorer, "uxtheme.dll", "OpenThemeDataForDpi", explorer_OpenThemeDataForDpi); |
|
|
|
VnPatchIAT(hExplorer, "uxtheme.dll", "DrawThemeBackground", explorer_DrawThemeBackground); |
|
|
|
VnPatchIAT(hExplorer, "uxtheme.dll", "DrawThemeBackground", explorer_DrawThemeBackground); |
|
|
|
|
|
|
|
VnPatchIAT(hExplorer, "uxtheme.dll", "CloseThemeData", explorer_CloseThemeData); |
|
|
|
if (bClassicThemeMitigations) |
|
|
|
if (bClassicThemeMitigations) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/*explorer_SetWindowThemeFunc = SetWindowTheme;
|
|
|
|
/*explorer_SetWindowThemeFunc = SetWindowTheme;
|
|
|
|
|