[SHELL32] Invoke the ItemIDList of shortcuts (#7152)

Invoking the IDList as if the target was double-clicked in Explorer fixes shortcuts to control panel items (both .cpl and ShellFolder types).

CORE-19690
This commit is contained in:
Whindmar Saksit 2024-07-22 19:31:48 +02:00 committed by GitHub
parent a45d375f60
commit f6a25d48d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 52 additions and 24 deletions

View file

@ -110,6 +110,21 @@ static int FindVerbInDefaultVerbList(LPCWSTR List, LPCWSTR Verb)
return -1;
}
EXTERN_C HRESULT SHELL32_EnumDefaultVerbList(LPCWSTR List, UINT Index, LPWSTR Verb, SIZE_T cchMax)
{
for (UINT i = 0; *List; ++i)
{
while (IsVerbListSeparator(*List))
List++;
LPCWSTR Start = List;
while (*List && !IsVerbListSeparator(*List))
List++;
if (List > Start && i == Index)
return StringCchCopyNW(Verb, cchMax, Start, List - Start);
}
return HRESULT_FROM_WIN32(ERROR_NO_MORE_ITEMS);
}
class CDefaultContextMenu :
public CComObjectRootEx<CComMultiThreadModelNoCS>,
public IContextMenu3,