mirror of
https://github.com/reactos/reactos.git
synced 2024-07-17 18:06:11 +00:00
[SHELL32] -Restore some code I incorrectly removed in r75360. CORE-13564
svn path=/trunk/; revision=75500
This commit is contained in:
parent
28cce7cb83
commit
7a138bc11f
|
@ -85,6 +85,44 @@ class CDesktopFolderEnum :
|
|||
// CComPtr fDesktopEnumerator;
|
||||
// CComPtr fCommonDesktopEnumerator;
|
||||
public:
|
||||
|
||||
void AddItemsFromClassicStartMenuKey(HKEY hKeyRoot)
|
||||
{
|
||||
DWORD dwResult;
|
||||
HKEY hkey;
|
||||
DWORD j = 0, dwVal, Val, dwType, dwIID;
|
||||
LONG r;
|
||||
WCHAR iid[50];
|
||||
LPITEMIDLIST pidl;
|
||||
|
||||
dwResult = RegOpenKeyExW(hKeyRoot, ClassicStartMenuW, 0, KEY_READ, &hkey);
|
||||
if (dwResult != ERROR_SUCCESS)
|
||||
return;
|
||||
|
||||
while(1)
|
||||
{
|
||||
dwVal = sizeof(Val);
|
||||
dwIID = sizeof(iid) / sizeof(WCHAR);
|
||||
|
||||
r = RegEnumValueW(hkey, j++, iid, &dwIID, NULL, &dwType, (LPBYTE)&Val, &dwVal);
|
||||
if (r != ERROR_SUCCESS)
|
||||
break;
|
||||
|
||||
if (Val == 0 && dwType == REG_DWORD)
|
||||
{
|
||||
pidl = _ILCreateGuidFromStrW(iid);
|
||||
if (pidl != NULL)
|
||||
{
|
||||
if (!HasItemWithCLSID(pidl))
|
||||
AddToEnumList(pidl);
|
||||
else
|
||||
SHFree(pidl);
|
||||
}
|
||||
}
|
||||
}
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
HRESULT WINAPI Initialize(DWORD dwFlags,IEnumIDList * pRegEnumerator, IEnumIDList *pDesktopEnumerator, IEnumIDList *pCommonDesktopEnumerator)
|
||||
{
|
||||
BOOL ret = TRUE;
|
||||
|
@ -112,6 +150,8 @@ class CDesktopFolderEnum :
|
|||
SHFree(pidl);
|
||||
}
|
||||
}
|
||||
AddItemsFromClassicStartMenuKey(HKEY_LOCAL_MACHINE);
|
||||
AddItemsFromClassicStartMenuKey(HKEY_CURRENT_USER);
|
||||
}
|
||||
|
||||
/* Enumerate the items in the two fs folders */
|
||||
|
|
Loading…
Reference in a new issue