mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SHELL32] CDefViewBckgrndMenu: Fix handling string verbs.
It shouldn't be necessary for QueryContextMenu to be called before InvokeCommand. Move retrieving the IContextMenu of the folder to the initialization of the class. CORE-12866
This commit is contained in:
parent
eb3987e172
commit
111c40e012
1 changed files with 7 additions and 3 deletions
|
@ -113,6 +113,11 @@ HRESULT
|
|||
CDefViewBckgrndMenu::Initialize(IShellFolder* psf)
|
||||
{
|
||||
m_psf = psf;
|
||||
|
||||
/* Get the context menu of the folder. Do it here because someone may call
|
||||
InvokeCommand without calling QueryContextMenu. It is fine if this fails */
|
||||
m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -154,9 +159,8 @@ CDefViewBckgrndMenu::QueryContextMenu(HMENU hMenu, UINT indexMenu, UINT idCmdFir
|
|||
but as stated above, its sole user is CDefView and should really be that way. */
|
||||
m_idCmdFirst = idCmdFirst;
|
||||
|
||||
/* Query the shell folder to add any items it wants to add in the background context menu */
|
||||
hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IContextMenu, &m_folderCM));
|
||||
if (SUCCEEDED(hr))
|
||||
/* Let the shell folder add any items it wants to add in the background context menu */
|
||||
if (m_folderCM)
|
||||
{
|
||||
hr = m_folderCM->QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
|
||||
if (SUCCEEDED(hr))
|
||||
|
|
Loading…
Reference in a new issue