if (IsEqualIID(riid, IID_IContextMenu) && (cidl >= 1))
{
- IContextMenu * pCm = NULL;
- hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, 0, NULL, &pCm);
+ IContextMenu * pCm = NULL;
+ HKEY hkey;
+ UINT cKeys = 0;
+ AddClassKeyToArray(L"Folder", &hkey, &cKeys);
+ hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, cidl, apidl, static_cast<IShellFolder*>(this), NULL, cKeys, &hkey, &pCm);
pObj = pCm;
}
else if (IsEqualIID(riid, IID_IDataObject) && (cidl >= 1))
void SHELL_FS_ProcessDisplayFilename(LPWSTR szPath, DWORD dwFlags);
BOOL SHELL_FS_HideExtension(LPWSTR pwszPath);
+void AddClassKeyToArray(const WCHAR * szClass, HKEY* array, UINT* cKeys);
+
#ifdef __cplusplus
HRESULT inline SHSetStrRet(LPSTRRET pStrRet, DWORD resId)
return MAKE_COMPARE_HRESULT(ret);
}
+void AddClassKeyToArray(const WCHAR * szClass, HKEY* array, UINT* cKeys)
+{
+ if (*cKeys >= 16)
+ return;
+
+ HKEY hkey;
+ LSTATUS result = RegOpenKeyExW(HKEY_CLASSES_ROOT, szClass, 0, KEY_READ | KEY_QUERY_VALUE, &hkey);
+ if (result != ERROR_SUCCESS)
+ return;
+
+ array[*cKeys] = hkey;
+ *cKeys += 1;
+}
+
/***********************************************************************
* SHCreateLinks
*