From c72c9c043faa1d2efeac6b9c6e5044ac8dd4a210 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Thu, 2 Sep 2021 04:57:01 +0300 Subject: [PATCH] Restored old behavior for triggering Explorer ready event --- ExplorerPatcher/dllmain.c | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 5c49e03..a4243e1 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -1656,9 +1656,37 @@ DWORD PlayStartupSound(DWORD unused) DWORD SignalShellReady(DWORD unused) { - Sleep(2000); printf("Started \"Signal shell ready\" thread.\n"); + while (TRUE) + { + HWND hWnd = FindWindowEx( + NULL, + NULL, + L"Shell_TrayWnd", + NULL + ); + if (hWnd) + { + hWnd = FindWindowEx( + hWnd, + NULL, + L"Start", + NULL + ); + if (hWnd) + { + if (IsWindowVisible(hWnd)) + { + break; + } + } + } + Sleep(100); + } + + Sleep(300); + HANDLE hEvent = CreateEvent(0, 0, 0, L"ShellDesktopSwitchEvent"); if (hEvent) {