From f4eefe2439dc2d1c1a297d7769ed14d8828bf7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20K=C3=BCng?= Date: Sat, 22 Jun 2024 13:58:18 +0200 Subject: [PATCH] for the top context menu, 'ClassicCom' is required since 'WinRtClassicComMix' will lead to IOleWindow->GetWindow(&hWnd) to return a null hwnd --- src/ExplorerCommandVerb/dllmain.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ExplorerCommandVerb/dllmain.cpp b/src/ExplorerCommandVerb/dllmain.cpp index a183cee1..bee5b358 100644 --- a/src/ExplorerCommandVerb/dllmain.cpp +++ b/src/ExplorerCommandVerb/dllmain.cpp @@ -127,7 +127,9 @@ std::wstring GetModuleDir(HMODULE hMod /*= nullptr*/) return GetParentDirectory(GetModulePath(hMod)); } -class ExplorerCommandBase : public RuntimeClass, IExplorerCommand, IObjectWithSite> +// note: for the top context menu, 'ClassicCom' is required since 'WinRtClassicComMix' will lead to +// IOleWindow->GetWindow(&hWnd) to return a null hwnd. +class ExplorerCommandBase : public RuntimeClass, IExplorerCommand, IObjectWithSite> { public: virtual const wchar_t* Title(IShellItemArray* items) = 0; @@ -291,9 +293,9 @@ class __declspec(uuid("3C557AFF-6181-4BBC-937D-E2FE8844DD49")) GrepWinExplorerCo } } - path = L"/searchpath:\"" + path + L"\""; + path = L"/searchpath:\"" + path + L"\""; - // try to launch the exe with the explorer instance: + // try to launch the exe with the explorer instance: // this avoids that the exe is started with the identity of this dll, // starting it as if it was started the normal way. bool execSucceeded = false;