mirror of
https://github.com/valinet/ExplorerPatcher.git
synced 2025-02-20 20:41:26 +01:00
Taskbar10: Attempt to fix potentially misaligned centered taskbar at startup
This commit is contained in:
parent
06f7cffe8b
commit
8c7b2954aa
@ -743,6 +743,16 @@ void LaunchNetworkTargets(DWORD dwTarget)
|
||||
|
||||
#pragma region "Service Window"
|
||||
#ifdef _WIN64
|
||||
void FixUpCenteredTaskbar()
|
||||
{
|
||||
InvalidateRect(FindWindowExW(FindWindowExW(FindWindowExW(FindWindowExW(NULL, NULL, L"Shell_TrayWnd", NULL), NULL, L"ReBarWindow32", NULL), NULL, L"MSTaskSwWClass", NULL), NULL, L"MSTaskListWClass", NULL), NULL, TRUE);
|
||||
HWND hWndTemp = NULL;
|
||||
while (hWndTemp = FindWindowExW(NULL, hWndTemp, L"Shell_SecondaryTrayWnd", NULL))
|
||||
{
|
||||
InvalidateRect(FindWindowExW(FindWindowExW(hWndTemp, NULL, L"WorkerW", NULL), NULL, L"MSTaskListWClass", NULL), NULL, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
#define EP_SERVICE_WINDOW_CLASS_NAME L"EP_Service_Window_" _T(EP_CLSID)
|
||||
LRESULT CALLBACK EP_Service_Window_WndProc(
|
||||
HWND hWnd,
|
||||
@ -755,6 +765,19 @@ LRESULT CALLBACK EP_Service_Window_WndProc(
|
||||
InvokeClockFlyout();
|
||||
return 0;
|
||||
}
|
||||
else if (uMsg == WM_TIMER && wParam == 1)
|
||||
{
|
||||
FixUpCenteredTaskbar();
|
||||
SetTimer(hWnd, 2, 1000, NULL);
|
||||
KillTimer(hWnd, 1);
|
||||
return 0;
|
||||
}
|
||||
else if (uMsg == WM_TIMER && wParam == 2)
|
||||
{
|
||||
FixUpCenteredTaskbar();
|
||||
KillTimer(hWnd, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
return DefWindowProcW(hWnd, uMsg, wParam, lParam);
|
||||
}
|
||||
@ -790,6 +813,10 @@ DWORD EP_ServiceWindowThread(DWORD unused)
|
||||
RegisterHotKey(hWnd, 1, MOD_WIN | MOD_NOREPEAT, 'C');
|
||||
}
|
||||
RegisterHotKey(hWnd, 2, MOD_WIN | MOD_ALT, 'D');
|
||||
if (bOldTaskbar && (dwOldTaskbarAl || dwMMOldTaskbarAl))
|
||||
{
|
||||
SetTimer(hWnd, 1, 5000, NULL);
|
||||
}
|
||||
MSG msg;
|
||||
BOOL bRet;
|
||||
while ((bRet = GetMessageW(&msg, NULL, 0, 0)) != 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user