From 9a7d2de43b823fdfbf4fd96b17975c4223839bd4 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Sat, 28 May 2022 12:55:15 +0300 Subject: [PATCH] Spotlight: Harden desktop window detection --- ExplorerPatcher/dllmain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 7cca972..1b48ac2 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -9235,7 +9235,7 @@ BOOL shell32_DeleteMenu(HMENU hMenu, UINT uPosition, UINT uFlags) BOOL shell32_TrackPopupMenu(HMENU hMenu, UINT uFlags, int x, int y, int nReserved, HWND hWnd, const RECT* prcRect) { - if (IsSpotlightEnabled() && dwSpotlightDesktopMenuMask && RegisterWindowMessageW(L"WorkerW") == GetClassWord(GetParent(hWnd), GCW_ATOM) && bSpotlightIsDesktopContextMenu) + if (IsSpotlightEnabled() && dwSpotlightDesktopMenuMask && (GetPropW(GetParent(hWnd), L"DesktopWindow") && RegisterWindowMessageW(L"WorkerW") == GetClassWord(GetParent(hWnd), GCW_ATOM)) && bSpotlightIsDesktopContextMenu) { SpotlightHelper(dwSpotlightDesktopMenuMask, hWnd, hMenu, NULL); }