mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:32:56 +00:00
[SHELL32]
* Merge r53661. svn path=/trunk/; revision=53662
This commit is contained in:
parent
d18bfcff5e
commit
859dd5c42a
2 changed files with 36 additions and 16 deletions
|
@ -31,8 +31,41 @@ CNewMenu::CNewMenu()
|
|||
szPath = NULL;
|
||||
}
|
||||
|
||||
|
||||
CNewMenu::~CNewMenu()
|
||||
{
|
||||
UnloadShellItems();
|
||||
}
|
||||
|
||||
void CNewMenu::UnloadItem(SHELLNEW_ITEM *item)
|
||||
{
|
||||
// bail if the item is clearly invalid
|
||||
if (NULL == item)
|
||||
return;
|
||||
|
||||
if (NULL != item->szTarget)
|
||||
free(item->szTarget);
|
||||
|
||||
free(item->szDesc);
|
||||
free(item->szIcon);
|
||||
free(item->szExt);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, item);
|
||||
}
|
||||
|
||||
void CNewMenu::UnloadShellItems()
|
||||
{
|
||||
SHELLNEW_ITEM *pCurItem;
|
||||
|
||||
while (s_SnHead)
|
||||
{
|
||||
pCurItem = s_SnHead;
|
||||
s_SnHead = s_SnHead->Next;
|
||||
|
||||
UnloadItem(pCurItem);
|
||||
}
|
||||
|
||||
s_SnHead = NULL;
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -87,22 +120,6 @@ GetKeyDescription(LPWSTR szKeyName, LPWSTR szResult)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void CNewMenu::UnloadItem(SHELLNEW_ITEM *item)
|
||||
{
|
||||
// bail if the item is clearly invalid
|
||||
if (NULL == item)
|
||||
return;
|
||||
|
||||
if (NULL != item->szTarget)
|
||||
free(item->szTarget);
|
||||
|
||||
free(item->szDesc);
|
||||
free(item->szIcon);
|
||||
free(item->szExt);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, item);
|
||||
}
|
||||
|
||||
CNewMenu::SHELLNEW_ITEM *CNewMenu::LoadItem(LPWSTR szKeyName)
|
||||
{
|
||||
HKEY hKey;
|
||||
|
@ -201,6 +218,8 @@ CNewMenu::LoadShellNewItems()
|
|||
szNew[0] = 0;
|
||||
szNew[MAX_PATH-1] = 0;
|
||||
|
||||
UnloadShellItems();
|
||||
|
||||
dwIndex = 0;
|
||||
do
|
||||
{
|
||||
|
|
|
@ -57,6 +57,7 @@ public:
|
|||
~CNewMenu();
|
||||
SHELLNEW_ITEM *LoadItem(LPWSTR szKeyName);
|
||||
void UnloadItem(SHELLNEW_ITEM *item);
|
||||
void UnloadShellItems();
|
||||
BOOL LoadShellNewItems();
|
||||
UINT InsertShellNewItems(HMENU hMenu, UINT idFirst, UINT idMenu);
|
||||
HRESULT DoShellNewCmd(LPCMINVOKECOMMANDINFO lpcmi);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue