From d009de44adaaf3a281b0ae35b699a42c1673323e Mon Sep 17 00:00:00 2001 From: Whindmar Saksit Date: Thu, 22 Aug 2024 14:34:22 +0200 Subject: [PATCH] [SHELL32] CDefaultContextMenu must forward the .lnk path (#7264) Forward the .lnk path (if any) so consrv gets STARTF_TITLEISLINKNAME and can apply console properties and icon from the shortcut. --- dll/win32/shell32/CDefaultContextMenu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dll/win32/shell32/CDefaultContextMenu.cpp b/dll/win32/shell32/CDefaultContextMenu.cpp index ed2e95bb1c7..751958da3f8 100644 --- a/dll/win32/shell32/CDefaultContextMenu.cpp +++ b/dll/win32/shell32/CDefaultContextMenu.cpp @@ -1357,6 +1357,9 @@ CDefaultContextMenu::InvokePidl(LPCMINVOKECOMMANDINFOEX lpcmi, LPCITEMIDLIST pid else if (!StrIsNullOrEmpty(lpcmi->lpParameters) && __SHCloneStrAtoW(&pszParamsW, lpcmi->lpParameters)) sei.lpParameters = pszParamsW; + if (!sei.lpClass && (lpcmi->fMask & (CMIC_MASK_HASLINKNAME | CMIC_MASK_HASTITLE)) && unicode) + sei.lpClass = lpcmi->lpTitleW; // Forward .lnk path from CShellLink::DoOpen (for consrv STARTF_TITLEISLINKNAME) + ShellExecuteExW(&sei); ILFree(pidlFull);