From 566bb81c7ecdbccee9b5415a0baf523c4f4b7dc6 Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Wed, 15 Jul 2026 14:10:25 +0200 Subject: [PATCH] Fix "Explore" getting stuck after Windows 11 update --- Src/StartMenu/StartMenuDLL/MenuCommands.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Src/StartMenu/StartMenuDLL/MenuCommands.cpp b/Src/StartMenu/StartMenuDLL/MenuCommands.cpp index ed396ac..ff85c70 100644 --- a/Src/StartMenu/StartMenuDLL/MenuCommands.cpp +++ b/Src/StartMenu/StartMenuDLL/MenuCommands.cpp @@ -71,6 +71,14 @@ static HRESULT InvokeCommandSafe(IContextMenu* pMenu, LPCMINVOKECOMMANDINFO pInf }); } +// Wrapper for SHOpenFolderAndSelectItems that runs on separate STA thread and pumps messages +static HRESULT SHOpenFolderAndSelectItemsSafe(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags) +{ + return ExecuteOnSTAThread([=]() { + return SHOpenFolderAndSelectItems(pidlFolder, cidl, apidl, dwFlags); + }); +} + static CString g_RenameText; static POINT g_RenamePos; @@ -2917,7 +2925,7 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p } else { - SHOpenFolderAndSelectItems(pItemPidl1,0,NULL,0); + SHOpenFolderAndSelectItemsSafe(pItemPidl1,0,NULL,0); } res=0; }