ReactOS 0.4.15-dev-8636-g945e856
CDefaultContextMenu Class Reference
Inheritance diagram for CDefaultContextMenu:
Collaboration diagram for CDefaultContextMenu:

Public Member Functions

 CDefaultContextMenu ()
 
 ~CDefaultContextMenu ()
 
HRESULT WINAPI Initialize (const DEFCONTEXTMENU *pdcm, LPFNDFMCALLBACK lpfn)
 
STDMETHOD() QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override
 
STDMETHOD() InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi) override
 
STDMETHOD() GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override
 
STDMETHOD() HandleMenuMsg (UINT uMsg, WPARAM wParam, LPARAM lParam) override
 
STDMETHOD() HandleMenuMsg2 (UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult) override
 
STDMETHOD() SetSite (IUnknown *pUnkSite) override
 
STDMETHOD() GetSite (REFIID riid, void **ppvSite) override
 
virtual HRESULT STDMETHODCALLTYPE QueryService (REFGUID svc, REFIID riid, void **ppv)
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT HandleMenuMsg2 ([in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam, [out] LRESULT *plResult)
 
HRESULT HandleMenuMsg ([in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam)
 
HRESULT QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags)
 
HRESULT InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici)
 
HRESULT GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
- Public Member Functions inherited from IObjectWithSite
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 
- Public Member Functions inherited from IServiceProvider
HRESULT QueryService ([in] REFGUID guidService, [in] REFIID riid, [out] void **ppvObject)
 
HRESULT RemoteQueryService ([in] REFGUID guidService, [in] REFIID riid, [out, iid_is(riid)] IUnknown **ppvObject)
 

Private Member Functions

HRESULT _DoCallback (UINT uMsg, WPARAM wParam, LPVOID lParam)
 
HRESULT _DoInvokeCommandCallback (LPCMINVOKECOMMANDINFOEX lpcmi, WPARAM CmdId)
 
void AddStaticEntry (const HKEY hkeyClass, const WCHAR *szVerb, UINT uFlags)
 
void AddStaticEntriesForKey (HKEY hKey, UINT uFlags)
 
void TryPickDefault (HMENU hMenu, UINT idCmdFirst, UINT DfltOffset, UINT uFlags)
 
BOOL IsShellExtensionAlreadyLoaded (REFCLSID clsid)
 
HRESULT LoadDynamicContextMenuHandler (HKEY hKey, REFCLSID clsid)
 
BOOL EnumerateDynamicContextHandlerForKey (HKEY hRootKey)
 
UINT AddShellExtensionsToMenu (HMENU hMenu, UINT *pIndexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
 
UINT AddStaticContextMenusToMenu (HMENU hMenu, UINT *IndexMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags)
 
HRESULT DoPaste (LPCMINVOKECOMMANDINFOEX lpcmi, BOOL bLink)
 
HRESULT DoOpenOrExplore (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoCreateLink (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoDelete (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoCopyOrCut (LPCMINVOKECOMMANDINFOEX lpcmi, BOOL bCopy)
 
HRESULT DoRename (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoProperties (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoUndo (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT DoCreateNewFolder (LPCMINVOKECOMMANDINFOEX lpici)
 
HRESULT DoCopyToMoveToFolder (LPCMINVOKECOMMANDINFOEX lpici, BOOL bCopy)
 
HRESULT InvokeShellExt (LPCMINVOKECOMMANDINFOEX lpcmi)
 
HRESULT InvokeRegVerb (LPCMINVOKECOMMANDINFOEX lpcmi)
 
DWORD BrowserFlagsFromVerb (LPCMINVOKECOMMANDINFOEX lpcmi, PStaticShellEntry pEntry)
 
HRESULT TryToBrowse (LPCMINVOKECOMMANDINFOEX lpcmi, LPCITEMIDLIST pidl, DWORD wFlags)
 
HRESULT InvokePidl (LPCMINVOKECOMMANDINFOEX lpcmi, LPCITEMIDLIST pidl, PStaticShellEntry pEntry)
 
PDynamicShellEntry GetDynamicEntry (UINT idCmd)
 
BOOL MapVerbToCmdId (PVOID Verb, PUINT idCmd, BOOL IsUnicode)
 

Private Attributes

CComPtr< IUnknownm_site
 
CComPtr< IShellFolderm_psf
 
CComPtr< IContextMenuCBm_pmcb
 
LPFNDFMCALLBACK m_pfnmcb
 
UINT m_cidl
 
PCUITEMID_CHILD_ARRAY m_apidl
 
CComPtr< IDataObjectm_pDataObj
 
HKEYm_aKeys
 
UINT m_cKeys
 
PIDLIST_ABSOLUTE m_pidlFolder
 
DWORD m_bGroupPolicyActive
 
CAtlList< DynamicShellEntrym_DynamicEntries
 
UINT m_iIdSHEFirst
 
UINT m_iIdSHELast
 
CAtlList< StaticShellEntrym_StaticEntries
 
UINT m_iIdSCMFirst
 
UINT m_iIdSCMLast
 
UINT m_iIdCBFirst
 
UINT m_iIdCBLast
 
UINT m_iIdDfltFirst
 
UINT m_iIdDfltLast
 
HWND m_hwnd
 
WCHAR m_DefVerbs [MAX_PATH]
 

Additional Inherited Members

- Public Types inherited from IContextMenu3
typedef IContextMenu3LPCONTEXTMENU3
 
- Public Types inherited from IContextMenu2
typedef IContextMenu2LPCONTEXTMENU2
 
- Public Types inherited from IContextMenu
typedef IContextMenuLPCONTEXTMENU
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFO CMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMINVOKECOMMANDINFOLPCMINVOKECOMMANDINFO
 
typedef struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
 
typedef struct IContextMenu::tagCMInvokeCommandInfoExLPCMINVOKECOMMANDINFOEX
 
- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Public Types inherited from IServiceProvider
typedef IServiceProviderLPSERVICEPROVIDER
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 
- Static Public Attributes inherited from IContextMenu
static const WCHAR CMDSTR_NEWFOLDERW [] = {'N','e','w','F','o','l','d','e','r',0}
 
static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0}
 
static const WCHAR CMDSTR_VIEWDETAILSW [] = {'V','i','e','w','D','e','t','a','i','l','s',0}
 

Detailed Description

Definition at line 128 of file CDefaultContextMenu.cpp.

Constructor & Destructor Documentation

◆ CDefaultContextMenu()

CDefaultContextMenu::CDefaultContextMenu ( )

Definition at line 222 of file CDefaultContextMenu.cpp.

222 :
223 m_psf(NULL),
224 m_pmcb(NULL),
225 m_pfnmcb(NULL),
226 m_cidl(0),
227 m_apidl(NULL),
229 m_aKeys(NULL),
230 m_cKeys(NULL),
233 m_iIdSHEFirst(0),
234 m_iIdSHELast(0),
235 m_iIdSCMFirst(0),
236 m_iIdSCMLast(0),
237 m_iIdCBFirst(0),
238 m_iIdCBLast(0),
240 m_iIdDfltLast(0),
241 m_hwnd(NULL)
242{
244}
CComPtr< IDataObject > m_pDataObj
CComPtr< IShellFolder > m_psf
PCUITEMID_CHILD_ARRAY m_apidl
CComPtr< IContextMenuCB > m_pmcb
PIDLIST_ABSOLUTE m_pidlFolder
#define NULL
Definition: types.h:112
#define UNICODE_NULL

◆ ~CDefaultContextMenu()

CDefaultContextMenu::~CDefaultContextMenu ( )

Definition at line 246 of file CDefaultContextMenu.cpp.

247{
248 for (POSITION it = m_DynamicEntries.GetHeadPosition(); it != NULL;)
249 {
250 const DynamicShellEntry& info = m_DynamicEntries.GetNext(it);
251 IUnknown_SetSite(info.pCM.p, NULL);
252 }
253 m_DynamicEntries.RemoveAll();
254 m_StaticEntries.RemoveAll();
255
256 for (UINT i = 0; i < m_cKeys; i++)
259
260 if (m_pidlFolder)
262 _ILFreeaPidl(const_cast<PITEMID_CHILD *>(m_apidl), m_cidl);
263}
#define RegCloseKey(hKey)
Definition: registry.h:49
CAtlList< StaticShellEntry > m_StaticEntries
CAtlList< DynamicShellEntry > m_DynamicEntries
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
HRESULT WINAPI IUnknown_SetSite(IUnknown *obj, IUnknown *site)
Definition: ordinal.c:1411
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
unsigned int UINT
Definition: ndis.h:50
void _ILFreeaPidl(LPITEMIDLIST *apidl, UINT cidl)
Definition: pidl.c:2600

Member Function Documentation

◆ _DoCallback()

HRESULT CDefaultContextMenu::_DoCallback ( UINT  uMsg,
WPARAM  wParam,
LPVOID  lParam 
)
private

Definition at line 313 of file CDefaultContextMenu.cpp.

314{
315 if (m_pmcb)
316 {
317 return m_pmcb->CallBack(m_psf, m_hwnd, m_pDataObj, uMsg, wParam, (LPARAM)lParam);
318 }
319 else if(m_pfnmcb)
320 {
322 }
323
324 return E_FAIL;
325}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define E_FAIL
Definition: ddrawi.h:102
LONG_PTR LPARAM
Definition: windef.h:208

Referenced by _DoInvokeCommandCallback(), QueryContextMenu(), and TryPickDefault().

◆ _DoInvokeCommandCallback()

HRESULT CDefaultContextMenu::_DoInvokeCommandCallback ( LPCMINVOKECOMMANDINFOEX  lpcmi,
WPARAM  CmdId 
)
private

Definition at line 1463 of file CDefaultContextMenu.cpp.

1465{
1466 BOOL Unicode = IsUnicode(*lpcmi);
1467 WCHAR lParamBuf[MAX_PATH];
1468 LPARAM lParam = 0;
1469
1470 if (Unicode && lpcmi->lpParametersW)
1471 lParam = (LPARAM)lpcmi->lpParametersW;
1472 else if (lpcmi->lpParameters)
1473 lParam = SHAnsiToUnicode(lpcmi->lpParameters, lParamBuf, _countof(lParamBuf)) ? (LPARAM)lParamBuf : 0;
1474
1475 HRESULT hr;
1476#if 0 // TODO: Try DFM_INVOKECOMMANDEX first.
1477 DFMICS dfmics = { sizeof(DFMICS), lpcmi->fMask, lParam, m_iIdSCMFirst?, m_iIdDfltLast?, (LPCMINVOKECOMMANDINFO)lpcmi, m_site };
1478 hr = _DoCallback(DFM_INVOKECOMMANDEX, CmdId, &dfmics);
1479 if (hr == E_NOTIMPL)
1480#endif
1481 hr = _DoCallback(DFM_INVOKECOMMAND, CmdId, (void*)lParam);
1482 return hr;
1483}
CComPtr< IUnknown > m_site
HRESULT _DoCallback(UINT uMsg, WPARAM wParam, LPVOID lParam)
#define E_NOTIMPL
Definition: ddrawi.h:99
#define DFM_INVOKECOMMANDEX
Definition: precomp.h:46
#define DFM_INVOKECOMMAND
Definition: precomp.h:45
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI SHAnsiToUnicode(LPCSTR lpSrcStr, LPWSTR lpDstStr, int iLen)
Definition: string.c:2667
unsigned int BOOL
Definition: ntddk_ex.h:94
struct IContextMenu::tagCMINVOKECOMMANDINFO * LPCMINVOKECOMMANDINFO
if(dx< 0)
Definition: linetemp.h:194
HRESULT hr
Definition: shlfolder.c:183
#define _countof(array)
Definition: sndvol32.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DoProperties(), and InvokeCommand().

◆ AddShellExtensionsToMenu()

UINT CDefaultContextMenu::AddShellExtensionsToMenu ( HMENU  hMenu,
UINT pIndexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
private

Definition at line 521 of file CDefaultContextMenu.cpp.

522{
523 UINT cIds = 0;
524
525 if (m_DynamicEntries.IsEmpty())
526 return cIds;
527
528 POSITION it = m_DynamicEntries.GetHeadPosition();
529 while (it != NULL)
530 {
532
533 HRESULT hr = info.pCM->QueryContextMenu(hMenu, *pIndexMenu, idCmdFirst + cIds, idCmdLast, uFlags);
534 if (SUCCEEDED(hr))
535 {
536 info.iIdCmdFirst = cIds;
537 info.NumIds = HRESULT_CODE(hr);
538 (*pIndexMenu) += info.NumIds;
539
540 cIds += info.NumIds;
541 if (idCmdFirst + cIds >= idCmdLast)
542 break;
543 }
544 TRACE("pEntry hr %x contextmenu %p cmdfirst %x num ids %x\n", hr, info.pCM.p, info.iIdCmdFirst, info.NumIds);
545 }
546 return cIds;
547}
UINT uFlags
Definition: api.c:59
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define TRACE(s)
Definition: solgame.cpp:4
#define HRESULT_CODE(hr)
Definition: winerror.h:76

Referenced by QueryContextMenu().

◆ AddStaticContextMenusToMenu()

UINT CDefaultContextMenu::AddStaticContextMenusToMenu ( HMENU  hMenu,
UINT IndexMenu,
UINT  iIdCmdFirst,
UINT  iIdCmdLast,
UINT  uFlags 
)
private

Definition at line 550 of file CDefaultContextMenu.cpp.

556{
558 MENUITEMINFOW mii = { sizeof(mii) };
559 UINT idResource;
560 WCHAR wszDispVerb[80]; // The limit on XP. If the friendly string is longer, it falls back to the verb key.
561 UINT fState;
562 UINT cIds = 0, indexFirst = *pIndexMenu, indexDefault;
563 int iDefVerbIndex = -1;
564
566 mii.fType = MFT_STRING;
567
568 POSITION it = m_StaticEntries.GetHeadPosition();
569 bool first = true;
570 while (it != NULL)
571 {
573 BOOL forceFirstPos = FALSE;
574
575 fState = MFS_ENABLED;
576
577 /* set first entry as default */
578 if (first)
579 {
580 fState |= MFS_DEFAULT;
581 first = false;
582 }
583
584 if (info.Verb.CompareNoCase(L"open") == 0)
585 {
586 idResource = IDS_OPEN_VERB;
587 fState |= MFS_DEFAULT; /* override default when open verb is found */
588 forceFirstPos++;
589 }
590 else if (info.Verb.CompareNoCase(L"explore") == 0)
591 {
592 idResource = IDS_EXPLORE_VERB;
593 if (uFlags & CMF_EXPLORE)
594 {
595 fState |= MFS_DEFAULT;
596 forceFirstPos++;
597 }
598 }
599 else if (info.Verb.CompareNoCase(L"runas") == 0)
600 idResource = IDS_RUNAS_VERB;
601 else if (info.Verb.CompareNoCase(L"edit") == 0)
602 idResource = IDS_EDIT_VERB;
603 else if (info.Verb.CompareNoCase(L"find") == 0)
604 idResource = IDS_FIND_VERB;
605 else if (info.Verb.CompareNoCase(L"print") == 0)
606 idResource = IDS_PRINT_VERB;
607 else if (info.Verb.CompareNoCase(L"printto") == 0)
608 continue;
609 else
610 idResource = 0;
611
612 /* By default use verb for menu item name */
613 mii.dwTypeData = (LPWSTR)info.Verb.GetString();
614
615 WCHAR wszKey[sizeof("shell\\") + MAX_VERB];
616 HRESULT hr;
617 hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", info.Verb.GetString());
619 {
620 continue;
621 }
622
623 UINT cmdFlags = 0;
624 bool hide = false;
625 HKEY hkVerb;
626 if (idResource > 0)
627 {
628 if (!(uFlags & CMF_OPTIMIZEFORINVOKE))
629 {
630 if (LoadStringW(shell32_hInstance, idResource, wszDispVerb, _countof(wszDispVerb)))
631 mii.dwTypeData = wszDispVerb; /* use translated verb */
632 else
633 ERR("Failed to load string\n");
634 }
635
636 if (RegOpenKeyW(info.hkClass, wszKey, &hkVerb) != ERROR_SUCCESS)
637 hkVerb = NULL;
638 }
639 else
640 {
641 if (RegOpenKeyW(info.hkClass, wszKey, &hkVerb) == ERROR_SUCCESS)
642 {
643 if (!(uFlags & CMF_OPTIMIZEFORINVOKE))
644 {
645 DWORD cbVerb = sizeof(wszDispVerb);
646 LONG res = RegLoadMUIStringW(hkVerb, L"MUIVerb", wszDispVerb, cbVerb, NULL, 0, NULL);
647 if (res || !*wszDispVerb)
648 res = RegLoadMUIStringW(hkVerb, NULL, wszDispVerb, cbVerb, NULL, 0, NULL);
649
650 if (res == ERROR_SUCCESS && *wszDispVerb)
651 {
652 /* use description for the menu entry */
653 mii.dwTypeData = wszDispVerb;
654 }
655 }
656 }
657 else
658 {
659 hkVerb = NULL;
660 }
661 }
662
663 if (hkVerb)
664 {
665 if (!(uFlags & CMF_EXTENDEDVERBS))
666 hide = RegValueExists(hkVerb, L"Extended");
667
668 if (!hide)
669 hide = RegValueExists(hkVerb, L"ProgrammaticAccessOnly");
670
671 if (!hide && !(uFlags & CMF_DISABLEDVERBS))
672 hide = RegValueExists(hkVerb, L"LegacyDisable");
673
674 if (RegValueExists(hkVerb, L"NeverDefault"))
675 fState &= ~MFS_DEFAULT;
676
677 if (RegValueExists(hkVerb, L"SeparatorBefore"))
678 cmdFlags |= ECF_SEPARATORBEFORE;
679 if (RegValueExists(hkVerb, L"SeparatorAfter"))
680 cmdFlags |= ECF_SEPARATORAFTER;
681
682 RegCloseKey(hkVerb);
683 }
684
685 if (((uFlags & CMF_NODEFAULT) && ntver >= _WIN32_WINNT_VISTA) ||
686 ((uFlags & CMF_DONOTPICKDEFAULT) && ntver >= _WIN32_WINNT_WIN7))
687 {
688 fState &= ~MFS_DEFAULT;
689 }
690
691 if (!hide)
692 {
693 if (cmdFlags & ECF_SEPARATORBEFORE)
694 {
695 if (InsertMenuItemAt(hMenu, *pIndexMenu, MF_SEPARATOR))
696 (*pIndexMenu)++;
697 }
698
699 UINT pos = *pIndexMenu;
700 int verbIndex = hkVerb ? FindVerbInDefaultVerbList(m_DefVerbs, info.Verb) : -1;
701 if (verbIndex >= 0)
702 {
703 if (verbIndex < iDefVerbIndex || iDefVerbIndex < 0)
704 {
705 iDefVerbIndex = verbIndex;
706 fState |= MFS_DEFAULT;
707 forceFirstPos = TRUE;
708 }
709 else
710 {
711 fState &= ~MFS_DEFAULT; // We have already set a better default
712 pos = indexDefault;
713 }
714 }
715 else if (iDefVerbIndex >= 0)
716 {
717 fState &= ~MFS_DEFAULT; // We have already set the default
718 if (forceFirstPos)
719 pos = indexDefault;
720 forceFirstPos = FALSE;
721 }
722
723 mii.fState = fState;
724 mii.wID = iIdCmdFirst + cIds;
725 if (InsertMenuItemW(hMenu, forceFirstPos ? indexFirst : pos, TRUE, &mii))
726 (*pIndexMenu)++;
727
728 if (cmdFlags & ECF_SEPARATORAFTER)
729 {
730 if (InsertMenuItemAt(hMenu, *pIndexMenu, MF_SEPARATOR))
731 (*pIndexMenu)++;
732 }
733
734 if (fState & MFS_DEFAULT)
735 indexDefault = *pIndexMenu; // This is where we want to insert "high priority" verbs
736 }
737 cIds++; // Always increment the id because it acts as the index into m_StaticEntries
738
739 if (mii.wID >= iIdCmdLast)
740 break;
741 }
742
743 return cIds;
744}
static bool RegValueExists(HKEY hKey, LPCWSTR Name)
static int FindVerbInDefaultVerbList(LPCWSTR List, LPCWSTR Verb)
static BOOL InsertMenuItemAt(HMENU hMenu, UINT Pos, UINT Flags)
#define MAX_VERB
#define shell32_hInstance
#define ERR(fmt,...)
Definition: precomp.h:57
static UINT RosGetProcessEffectiveVersion(VOID)
Definition: compat_undoc.h:39
#define ERROR_SUCCESS
Definition: deptool.c:10
LONG RegLoadMUIStringW(IN HKEY hKey, IN LPCWSTR pszValue OPTIONAL, OUT LPWSTR pszOutBuf, IN DWORD cbOutBuf, OUT LPDWORD pcbData OPTIONAL, IN DWORD Flags, IN LPCWSTR pszDirectory OPTIONAL)
Definition: muireg.c:53
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3268
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint res
Definition: glext.h:9613
const GLint * first
Definition: glext.h:5794
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define _WIN32_WINNT_WIN7
Definition: sdkddkver.h:28
#define _WIN32_WINNT_VISTA
Definition: sdkddkver.h:25
#define IDS_OPEN_VERB
Definition: shresdef.h:213
#define IDS_FIND_VERB
Definition: shresdef.h:217
#define IDS_EXPLORE_VERB
Definition: shresdef.h:214
#define IDS_PRINT_VERB
Definition: shresdef.h:218
#define IDS_RUNAS_VERB
Definition: shresdef.h:215
#define IDS_EDIT_VERB
Definition: shresdef.h:216
STRSAFEAPI StringCbPrintfW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:557
LPWSTR dwTypeData
Definition: winuser.h:3272
#define MIIM_ID
Definition: winuser.h:725
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define MIIM_STATE
Definition: winuser.h:724
#define MFS_DEFAULT
Definition: winuser.h:751
#define MF_SEPARATOR
Definition: winuser.h:137
#define MFS_ENABLED
Definition: winuser.h:753
#define MFT_STRING
Definition: winuser.h:749
#define MIIM_DATA
Definition: winuser.h:729
#define MIIM_TYPE
Definition: winuser.h:728
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by QueryContextMenu().

◆ AddStaticEntriesForKey()

void CDefaultContextMenu::AddStaticEntriesForKey ( HKEY  hKey,
UINT  uFlags 
)
private

Definition at line 353 of file CDefaultContextMenu.cpp.

354{
355 WCHAR wszName[VERBKEY_CCHMAX];
356 DWORD cchName, dwIndex = 0;
357 HKEY hShellKey;
358
359 LRESULT lres = RegOpenKeyExW(hKey, L"shell", 0, KEY_READ, &hShellKey);
360 if (lres != STATUS_SUCCESS)
361 return;
362
363 if (!*m_DefVerbs)
364 {
365 DWORD cb = sizeof(m_DefVerbs);
367 }
368
369 while(TRUE)
370 {
371 cchName = _countof(wszName);
372 if (RegEnumKeyExW(hShellKey, dwIndex++, wszName, &cchName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
373 break;
374
375 AddStaticEntry(hKey, wszName, uFlags);
376 }
377
378 RegCloseKey(hShellKey);
379}
void AddStaticEntry(const HKEY hkeyClass, const WCHAR *szVerb, UINT uFlags)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2504
#define RRF_RT_REG_SZ
Definition: driver.c:575
#define VERBKEY_CCHMAX
Definition: precomp.h:130
FxAutoRegKey hKey
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define KEY_READ
Definition: nt_native.h:1023
#define STATUS_SUCCESS
Definition: shellext.h:65
_In_ PSID _Out_writes_to_opt_ cchName LPSTR _Inout_ LPDWORD cchName
Definition: winbase.h:2767
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by QueryContextMenu().

◆ AddStaticEntry()

void CDefaultContextMenu::AddStaticEntry ( const HKEY  hkeyClass,
const WCHAR szVerb,
UINT  uFlags 
)
private

Definition at line 327 of file CDefaultContextMenu.cpp.

328{
329 POSITION it = m_StaticEntries.GetHeadPosition();
330 while (it != NULL)
331 {
332 const StaticShellEntry& info = m_StaticEntries.GetNext(it);
333 if (info.Verb.CompareNoCase(szVerb) == 0)
334 {
335 /* entry already exists */
336 return;
337 }
338 }
339
340 TRACE("adding verb %s\n", debugstr_w(szVerb));
341
342 if (!wcsicmp(szVerb, L"open") && !(uFlags & CMF_NODEFAULT))
343 {
344 /* open verb is always inserted in front */
345 m_StaticEntries.AddHead({ szVerb, hkeyClass });
346 }
347 else
348 {
349 m_StaticEntries.AddTail({ szVerb, hkeyClass });
350 }
351}
#define wcsicmp
Definition: compat.h:15
#define debugstr_w
Definition: kernel32.h:32

Referenced by AddStaticEntriesForKey().

◆ BrowserFlagsFromVerb()

DWORD CDefaultContextMenu::BrowserFlagsFromVerb ( LPCMINVOKECOMMANDINFOEX  lpcmi,
PStaticShellEntry  pEntry 
)
private

Definition at line 1240 of file CDefaultContextMenu.cpp.

1241{
1243 HWND hwndTree;
1244 LPCWSTR FlagsName;
1245 WCHAR wszKey[sizeof("shell\\") + MAX_VERB];
1246 HRESULT hr;
1247 DWORD wFlags;
1248 DWORD cbVerb;
1249
1250 if (!m_site)
1251 return 0;
1252
1253 /* Get a pointer to the shell browser */
1255 if (FAILED(hr))
1256 return 0;
1257
1258 /* See if we are in Explore or Browse mode. If the browser's tree is present, we are in Explore mode.*/
1259 if (SUCCEEDED(psb->GetControlWindow(FCW_TREE, &hwndTree)) && hwndTree)
1260 FlagsName = L"ExplorerFlags";
1261 else
1262 FlagsName = L"BrowserFlags";
1263
1265 if (SUCCEEDED(psb->QueryInterface(IID_PPV_ARG(ICommDlgBrowser, &pcdb))))
1266 {
1267 if (LOBYTE(GetVersion()) < 6 || FlagsName[0] == 'E')
1268 return 0; // Don't browse in-place
1269 }
1270
1271 /* Try to get the flag from the verb */
1272 hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", pEntry->Verb.GetString());
1274 return 0;
1275
1276 cbVerb = sizeof(wFlags);
1277 if (RegGetValueW(pEntry->hkClass, wszKey, FlagsName, RRF_RT_REG_DWORD, NULL, &wFlags, &cbVerb) == ERROR_SUCCESS)
1278 {
1279 return wFlags;
1280 }
1281
1282 return 0;
1283}
#define RRF_RT_REG_DWORD
Definition: driver.c:578
HRESULT WINAPI IUnknown_QueryService(IUnknown *, REFGUID, REFIID, LPVOID *)
Definition: ordinal.c:1501
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define FAILED(hr)
Definition: intsafe.h:51
#define LOBYTE(W)
Definition: jmemdos.c:487
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
#define SID_IShellBrowser
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define IID_PPV_ARG(Itype, ppType)
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by InvokeRegVerb().

◆ DoCopyOrCut()

HRESULT CDefaultContextMenu::DoCopyOrCut ( LPCMINVOKECOMMANDINFOEX  lpcmi,
BOOL  bCopy 
)
private

Definition at line 1004 of file CDefaultContextMenu.cpp.

1005{
1006 if (!m_cidl || !m_pDataObj)
1007 return E_FAIL;
1008
1009 FORMATETC formatetc;
1011 STGMEDIUM medium = {0};
1012 medium.tymed = TYMED_HGLOBAL;
1013 medium.hGlobal = GlobalAlloc(GHND, sizeof(DWORD));
1014 DWORD* pdwFlag = (DWORD*)GlobalLock(medium.hGlobal);
1015 if (pdwFlag)
1016 *pdwFlag = bCopy ? DROPEFFECT_COPY : DROPEFFECT_MOVE;
1017 GlobalUnlock(medium.hGlobal);
1018 m_pDataObj->SetData(&formatetc, &medium, TRUE);
1019
1022 return hr;
1023
1024 return S_OK;
1025}
HRESULT WINAPI OleSetClipboard(IDataObject *data)
Definition: clipboard.c:2199
#define InitFormatEtc(fe, cf, med)
Definition: editor.h:32
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define S_OK
Definition: intsafe.h:52
#define CFSTR_PREFERREDDROPEFFECT
Definition: shlobj.h:560
#define GHND
Definition: winbase.h:297
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)

Referenced by InvokeCommand().

◆ DoCopyToMoveToFolder()

HRESULT CDefaultContextMenu::DoCopyToMoveToFolder ( LPCMINVOKECOMMANDINFOEX  lpici,
BOOL  bCopy 
)
private

Definition at line 1076 of file CDefaultContextMenu.cpp.

1077{
1078 HRESULT hr = E_FAIL;
1079 if (!m_pDataObj)
1080 {
1081 ERR("m_pDataObj is NULL\n");
1082 return hr;
1083 }
1084
1085 CComPtr<IContextMenu> pContextMenu;
1086 if (bCopy)
1087 hr = SHCoCreateInstance(NULL, &CLSID_CopyToMenu, NULL,
1088 IID_PPV_ARG(IContextMenu, &pContextMenu));
1089 else
1090 hr = SHCoCreateInstance(NULL, &CLSID_MoveToMenu, NULL,
1091 IID_PPV_ARG(IContextMenu, &pContextMenu));
1093 return hr;
1094
1096 hr = pContextMenu->QueryInterface(IID_PPV_ARG(IShellExtInit, &pInit));
1098 return hr;
1099
1100 hr = pInit->Initialize(m_pidlFolder, m_pDataObj, NULL);
1102 return hr;
1103
1104 if (bCopy)
1105 lpici->lpVerb = "copyto";
1106 else
1107 lpici->lpVerb = "moveto";
1108
1109 return pContextMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)lpici);
1110}
HRESULT WINAPI SHCoCreateInstance(LPCWSTR aclsid, const CLSID *clsid, LPUNKNOWN pUnkOuter, REFIID refiid, LPVOID *ppv)
Definition: shellole.c:105
PWDFDEVICE_INIT pInit

Referenced by InvokeCommand().

◆ DoCreateLink()

HRESULT CDefaultContextMenu::DoCreateLink ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 973 of file CDefaultContextMenu.cpp.

974{
975 if (!m_cidl || !m_pDataObj)
976 return E_FAIL;
977
979 HRESULT hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pDT));
981 return hr;
982
984
985 return S_OK;
986}
BOOL WINAPI SHSimulateDrop(IDropTarget *pDrop, IDataObject *pDataObj, DWORD grfKeyState, PPOINTL lpPt, DWORD *pdwEffect)
Definition: ordinal.c:1828
#define MK_SHIFT
Definition: winuser.h:2372
#define MK_CONTROL
Definition: winuser.h:2373

Referenced by InvokeCommand().

◆ DoCreateNewFolder()

HRESULT CDefaultContextMenu::DoCreateNewFolder ( LPCMINVOKECOMMANDINFOEX  lpici)
private

Definition at line 1114 of file CDefaultContextMenu.cpp.

1116{
1117 WCHAR wszPath[MAX_PATH];
1118 WCHAR wszName[MAX_PATH];
1119 WCHAR wszNewFolder[25];
1120 HRESULT hr;
1121
1122 /* Get folder path */
1125 return hr;
1126
1127 if (!LoadStringW(shell32_hInstance, IDS_NEWFOLDER, wszNewFolder, _countof(wszNewFolder)))
1128 return E_FAIL;
1129
1130 /* Create the name of the new directory */
1131 if (!PathYetAnotherMakeUniqueName(wszName, wszPath, NULL, wszNewFolder))
1132 return E_FAIL;
1133
1134 /* Create the new directory and show the appropriate dialog in case of error */
1135 if (SHCreateDirectory(lpici->hwnd, wszName) != ERROR_SUCCESS)
1136 return E_FAIL;
1137
1138 /* Show and select the new item in the def view */
1139 LPITEMIDLIST pidl;
1140 PITEMID_CHILD pidlNewItem;
1142
1143 /* Notify the view object about the new item */
1145
1146 if (!m_site)
1147 return S_OK;
1148
1149 /* Get a pointer to the shell view */
1152 return S_OK;
1153
1154 /* Attempt to get the pidl of the new item */
1155 hr = SHILCreateFromPathW(wszName, &pidl, NULL);
1157 return hr;
1158
1159 pidlNewItem = ILFindLastID(pidl);
1160
1161 hr = psv->SelectItem(pidlNewItem, SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE |
1162 SVSI_FOCUSED | SVSI_SELECT);
1164 return hr;
1165
1166 SHFree(pidl);
1167
1168 return S_OK;
1169}
EXTERN_C void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
void WINAPI SHFree(LPVOID pv)
Definition: shellole.c:326
BOOL WINAPI PathYetAnotherMakeUniqueName(LPWSTR buffer, LPCWSTR path, LPCWSTR shortname, LPCWSTR longname)
Definition: shellpath.c:699
#define IDS_NEWFOLDER
HRESULT WINAPI SHILCreateFromPathW(LPCWSTR path, LPITEMIDLIST *ppidl, DWORD *attributes)
Definition: pidl.c:401
LPITEMIDLIST WINAPI ILFindLastID(LPCITEMIDLIST pidl)
Definition: pidl.c:198
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1348
int WINAPI SHCreateDirectory(HWND hWnd, LPCWSTR path)
Definition: shlfileop.cpp:847
#define SID_IFolderView
#define SHCNE_MKDIR
Definition: shlobj.h:1893
#define SHCNF_FLUSH
Definition: shlobj.h:1928
#define SHCNF_PATHW
Definition: shlobj.h:1925
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
CONST void * LPCVOID
Definition: windef.h:191

Referenced by InvokeCommand().

◆ DoDelete()

HRESULT CDefaultContextMenu::DoDelete ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 988 of file CDefaultContextMenu.cpp.

989{
990 if (!m_cidl || !m_pDataObj)
991 return E_FAIL;
992
996 return hr;
997
998 DWORD grfKeyState = (lpcmi->fMask & CMIC_MASK_SHIFT_DOWN) ? MK_SHIFT : 0;
999 SHSimulateDrop(pDT, m_pDataObj, grfKeyState, NULL, NULL);
1000
1001 return S_OK;
1002}
HRESULT CRecyclerDropTarget_CreateInstance(REFIID riid, LPVOID *ppvOut)

Referenced by InvokeCommand().

◆ DoOpenOrExplore()

HRESULT CDefaultContextMenu::DoOpenOrExplore ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 967 of file CDefaultContextMenu.cpp.

968{
970 return E_FAIL;
971}
#define UNIMPLEMENTED
Definition: debug.h:118

Referenced by InvokeCommand().

◆ DoPaste()

HRESULT CDefaultContextMenu::DoPaste ( LPCMINVOKECOMMANDINFOEX  lpcmi,
BOOL  bLink 
)
private

Definition at line 914 of file CDefaultContextMenu.cpp.

915{
916 HRESULT hr;
917
919 hr = OleGetClipboard(&pda);
921 return hr;
922
923 FORMATETC formatetc2;
924 STGMEDIUM medium2;
926
927 DWORD dwKey= 0;
928
929 if (SUCCEEDED(pda->GetData(&formatetc2, &medium2)))
930 {
931 DWORD * pdwFlag = (DWORD*)GlobalLock(medium2.hGlobal);
932 if (pdwFlag)
933 {
934 if (*pdwFlag == DROPEFFECT_COPY)
935 dwKey = MK_CONTROL;
936 else
937 dwKey = MK_SHIFT;
938 }
939 else
940 {
941 ERR("No drop effect obtained\n");
942 }
943 GlobalUnlock(medium2.hGlobal);
944 }
945
946 if (bLink)
947 {
948 dwKey = MK_CONTROL|MK_SHIFT;
949 }
950
952 if (m_cidl)
953 hr = m_psf->GetUIObjectOf(NULL, 1, &m_apidl[0], IID_NULL_PPV_ARG(IDropTarget, &pdrop));
954 else
955 hr = m_psf->CreateViewObject(NULL, IID_PPV_ARG(IDropTarget, &pdrop));
956
958 return hr;
959
960 SHSimulateDrop(pdrop, pda, dwKey, NULL, NULL);
961
962 TRACE("CP result %x\n", hr);
963 return S_OK;
964}
HRESULT WINAPI OleGetClipboard(IDataObject **obj)
Definition: clipboard.c:2249
#define IID_NULL_PPV_ARG(Itype, ppType)

Referenced by InvokeCommand().

◆ DoProperties()

HRESULT CDefaultContextMenu::DoProperties ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 1054 of file CDefaultContextMenu.cpp.

1056{
1058
1059 // We are asked to run the default property sheet
1060 if (hr == S_FALSE)
1061 {
1063 }
1064
1065 return hr;
1066}
HRESULT _DoInvokeCommandCallback(LPCMINVOKECOMMANDINFOEX lpcmi, WPARAM CmdId)
HRESULT SHELL32_ShowPropertiesDialog(IDataObject *pdtobj)
Definition: shlfolder.cpp:532
#define DFM_CMD_PROPERTIES
Definition: shlobj.h:2612
#define S_FALSE
Definition: winerror.h:2357

Referenced by InvokeCommand().

◆ DoRename()

HRESULT CDefaultContextMenu::DoRename ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 1027 of file CDefaultContextMenu.cpp.

1028{
1030 HRESULT hr;
1031
1032 if (!m_site || !m_cidl)
1033 return E_FAIL;
1034
1035 /* Get a pointer to the shell browser */
1038 return hr;
1039
1041 hr = psb->QueryActiveShellView(&lpSV);
1043 return hr;
1044
1045 SVSIF selFlags = SVSI_DESELECTOTHERS | SVSI_EDIT | SVSI_ENSUREVISIBLE | SVSI_FOCUSED | SVSI_SELECT;
1046 hr = lpSV->SelectItem(m_apidl[0], selFlags);
1048 return hr;
1049
1050 return S_OK;
1051}

Referenced by InvokeCommand().

◆ DoUndo()

HRESULT CDefaultContextMenu::DoUndo ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 1069 of file CDefaultContextMenu.cpp.

1070{
1071 ERR("TODO: Undo\n");
1072 return E_NOTIMPL;
1073}

Referenced by InvokeCommand().

◆ EnumerateDynamicContextHandlerForKey()

BOOL CDefaultContextMenu::EnumerateDynamicContextHandlerForKey ( HKEY  hRootKey)
private

Definition at line 457 of file CDefaultContextMenu.cpp.

458{
459 WCHAR wszName[MAX_PATH], wszBuf[MAX_PATH], *pwszClsid;
461 HRESULT hr;
462 HKEY hKey;
463
464 if (RegOpenKeyExW(hRootKey, L"shellex\\ContextMenuHandlers", 0, KEY_READ, &hKey) != ERROR_SUCCESS)
465 {
466 TRACE("RegOpenKeyExW failed\n");
467 return FALSE;
468 }
469
470 DWORD dwIndex = 0;
471 while (TRUE)
472 {
473 cchName = _countof(wszName);
474 if (RegEnumKeyExW(hKey, dwIndex++, wszName, &cchName, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
475 break;
476
477 /* Key name or key value is CLSID */
478 CLSID clsid;
479 hr = CLSIDFromString(wszName, &clsid);
480 if (hr == S_OK)
481 pwszClsid = wszName;
482 else
483 {
484 DWORD cchBuf = _countof(wszBuf);
485 if (RegGetValueW(hKey, wszName, NULL, RRF_RT_REG_SZ, NULL, wszBuf, &cchBuf) == ERROR_SUCCESS)
486 hr = CLSIDFromString(wszBuf, &clsid);
487 pwszClsid = wszBuf;
488 }
489
490 if (FAILED(hr))
491 {
492 ERR("CLSIDFromString failed for clsid %S hr 0x%x\n", pwszClsid, hr);
493 continue;
494 }
495
497 {
499 L"Software\\Microsoft\\Windows\\CurrentVersion\\Shell Extensions\\Approved",
500 pwszClsid,
502 NULL,
503 NULL,
505 {
506 ERR("Shell extension %s not approved!\n", pwszClsid);
507 continue;
508 }
509 }
510
512 if (FAILED(hr))
513 WARN("Failed to get context menu entires from shell extension! clsid: %S\n", pwszClsid);
514 }
515
517 return TRUE;
518}
#define WARN(fmt,...)
Definition: precomp.h:61
HRESULT LoadDynamicContextMenuHandler(HKEY hKey, REFCLSID clsid)
HRESULT WINAPI CLSIDFromString(LPCOLESTR idstr, LPCLSID id)
Definition: compobj.c:2338
REFCLSID clsid
Definition: msctf.c:82
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by QueryContextMenu().

◆ GetCommandString()

HRESULT WINAPI CDefaultContextMenu::GetCommandString ( UINT_PTR  idCommand,
UINT  uFlags,
UINT lpReserved,
LPSTR  lpszName,
UINT  uMaxNameLen 
)
override

Implements IContextMenu.

Definition at line 1596 of file CDefaultContextMenu.cpp.

1602{
1603 /* We don't handle the help text yet */
1604 if (uFlags == GCS_HELPTEXTA ||
1605 uFlags == GCS_HELPTEXTW ||
1606 HIWORD(idCommand) != 0)
1607 {
1608 return E_NOTIMPL;
1609 }
1610
1611 UINT CmdId = LOWORD(idCommand);
1612
1613 if (!m_DynamicEntries.IsEmpty() && CmdId >= m_iIdSHEFirst && CmdId < m_iIdSHELast)
1614 {
1615 idCommand -= m_iIdSHEFirst;
1617 if (!pEntry)
1618 return E_FAIL;
1619
1620 idCommand -= pEntry->iIdCmdFirst;
1621 return pEntry->pCM->GetCommandString(idCommand,
1622 uFlags,
1623 lpReserved,
1624 lpszName,
1625 uMaxNameLen);
1626 }
1627
1628 if (!m_StaticEntries.IsEmpty() && CmdId >= m_iIdSCMFirst && CmdId < m_iIdSCMLast)
1629 {
1630 /* Validation just returns S_OK on a match. The id exists. */
1631 if (uFlags == GCS_VALIDATEA || uFlags == GCS_VALIDATEW)
1632 return S_OK;
1633
1634 CmdId -= m_iIdSCMFirst;
1635
1636 POSITION it = m_StaticEntries.FindIndex(CmdId);
1637
1638 if (it == NULL)
1639 return E_INVALIDARG;
1640
1642
1643 if (uFlags == GCS_VERBW)
1644 return StringCchCopyW((LPWSTR)lpszName, uMaxNameLen, pEntry->Verb);
1645
1646 if (uFlags == GCS_VERBA)
1647 {
1648 if (SHUnicodeToAnsi(pEntry->Verb, lpszName, uMaxNameLen))
1649 return S_OK;
1650 }
1651
1652 return E_INVALIDARG;
1653 }
1654
1655 //FIXME: Should we handle callbacks here?
1656 if (m_iIdDfltFirst != m_iIdDfltLast && CmdId >= m_iIdDfltFirst && CmdId < m_iIdDfltLast)
1657 {
1658 CmdId -= m_iIdDfltFirst;
1659 /* See the definitions of IDM_CUT and co to see how this works */
1660 CmdId += DCM_FCIDM_SHVIEW_OFFSET;
1661 }
1662
1663 /* Loop looking for a matching Id */
1664 for (UINT i = 0; i < _countof(g_StaticInvokeCmdMap); i++)
1665 {
1666 if (g_StaticInvokeCmdMap[i].IntVerb == CmdId)
1667 {
1668 /* Validation just returns S_OK on a match */
1669 if (uFlags == GCS_VALIDATEA || uFlags == GCS_VALIDATEW)
1670 return S_OK;
1671
1672 /* Return a copy of the ANSI verb */
1673 if (uFlags == GCS_VERBA)
1674 return StringCchCopyA(lpszName, uMaxNameLen, g_StaticInvokeCmdMap[i].szStringVerb);
1675
1676 /* Convert the ANSI verb to unicode and return that */
1677 if (uFlags == GCS_VERBW)
1678 {
1679 if (SHAnsiToUnicode(g_StaticInvokeCmdMap[i].szStringVerb, (LPWSTR)lpszName, uMaxNameLen))
1680 return S_OK;
1681 }
1682 }
1683 }
1684
1685 return E_INVALIDARG;
1686}
static const struct _StaticInvokeCommandMap_ g_StaticInvokeCmdMap[]
#define DCM_FCIDM_SHVIEW_OFFSET
PDynamicShellEntry GetDynamicEntry(UINT idCmd)
#define E_INVALIDARG
Definition: ddrawi.h:101
INT WINAPI SHUnicodeToAnsi(LPCWSTR lpSrcStr, LPSTR lpDstStr, INT iLen)
Definition: string.c:2791
#define LOWORD(l)
Definition: pedump.c:82
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
STRSAFEAPI StringCchCopyA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc)
Definition: strsafe.h:145
#define HIWORD(l)
Definition: typedefs.h:247

◆ GetDynamicEntry()

PDynamicShellEntry CDefaultContextMenu::GetDynamicEntry ( UINT  idCmd)
private

Definition at line 1171 of file CDefaultContextMenu.cpp.

1172{
1173 POSITION it = m_DynamicEntries.GetHeadPosition();
1174 while (it != NULL)
1175 {
1177
1178 if (idCmd >= info.iIdCmdFirst + info.NumIds)
1179 continue;
1180
1181 if (idCmd < info.iIdCmdFirst || idCmd > info.iIdCmdFirst + info.NumIds)
1182 return NULL;
1183
1184 return &info;
1185 }
1186
1187 return NULL;
1188}

Referenced by GetCommandString(), HandleMenuMsg2(), and InvokeShellExt().

◆ GetSite()

HRESULT WINAPI CDefaultContextMenu::GetSite ( REFIID  riid,
void **  ppvSite 
)
override

Definition at line 1783 of file CDefaultContextMenu.cpp.

1784{
1785 if (!m_site)
1786 return E_FAIL;
1787
1788 return m_site->QueryInterface(riid, ppvSite);
1789}
REFIID riid
Definition: atlbase.h:39

◆ HandleMenuMsg()

HRESULT WINAPI CDefaultContextMenu::HandleMenuMsg ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)
override

Implements IContextMenu2.

Definition at line 1690 of file CDefaultContextMenu.cpp.

1694{
1695 /* FIXME: Should we implement this as well? */
1696 return S_OK;
1697}

◆ HandleMenuMsg2()

HRESULT WINAPI CDefaultContextMenu::HandleMenuMsg2 ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
LRESULT plResult 
)
override

Implements IContextMenu3.

Definition at line 1737 of file CDefaultContextMenu.cpp.

1742{
1743 if (uMsg == WM_INITMENUPOPUP)
1744 {
1745 POSITION it = m_DynamicEntries.GetHeadPosition();
1746 while (it != NULL)
1747 {
1749 SHForwardContextMenuMsg(info.pCM, uMsg, wParam, lParam, plResult, TRUE);
1750 }
1751 return S_OK;
1752 }
1753
1754 UINT CmdId;
1755 HRESULT hr = SHGetMenuIdFromMenuMsg(uMsg, lParam, &CmdId);
1756 if (FAILED(hr))
1757 return S_FALSE;
1758
1759 if (CmdId < m_iIdSHEFirst || CmdId >= m_iIdSHELast)
1760 return S_FALSE;
1761
1762 CmdId -= m_iIdSHEFirst;
1764 if (pEntry)
1765 {
1766 SHSetMenuIdInMenuMsg(uMsg, lParam, CmdId - pEntry->iIdCmdFirst);
1767 SHForwardContextMenuMsg(pEntry->pCM, uMsg, wParam, lParam, plResult, TRUE);
1768 }
1769
1770 return S_OK;
1771}
HRESULT SHSetMenuIdInMenuMsg(UINT uMsg, LPARAM lParam, UINT CmdId)
HRESULT SHGetMenuIdFromMenuMsg(UINT uMsg, LPARAM lParam, UINT *CmdId)
HRESULT WINAPI SHForwardContextMenuMsg(IUnknown *pUnk, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *pResult, BOOL useIContextMenu2)
Definition: rosordinal.c:11
#define WM_INITMENUPOPUP
Definition: winuser.h:1749

◆ Initialize()

HRESULT WINAPI CDefaultContextMenu::Initialize ( const DEFCONTEXTMENU pdcm,
LPFNDFMCALLBACK  lpfn 
)

Definition at line 265 of file CDefaultContextMenu.cpp.

266{
267 TRACE("cidl %u\n", pdcm->cidl);
268
269 if (!pdcm->pcmcb && !lpfn)
270 {
271 ERR("CDefaultContextMenu needs a callback!\n");
272 return E_INVALIDARG;
273 }
274
275 m_cidl = pdcm->cidl;
277 if (m_cidl && !m_apidl)
278 return E_OUTOFMEMORY;
279 m_psf = pdcm->psf;
280 m_pmcb = pdcm->pcmcb;
281 m_pfnmcb = lpfn;
282 m_hwnd = pdcm->hwnd;
283
284 m_cKeys = pdcm->cKeys;
285 if (pdcm->cKeys)
286 {
287 m_aKeys = (HKEY*)HeapAlloc(GetProcessHeap(), 0, sizeof(HKEY) * pdcm->cKeys);
288 if (!m_aKeys)
289 return E_OUTOFMEMORY;
290 memcpy(m_aKeys, pdcm->aKeys, sizeof(HKEY) * pdcm->cKeys);
291 }
292
293 m_psf->GetUIObjectOf(pdcm->hwnd, m_cidl, m_apidl, IID_NULL_PPV_ARG(IDataObject, &m_pDataObj));
294
295 if (pdcm->pidlFolder)
296 {
298 }
299 else
300 {
302 if (SUCCEEDED(m_psf->QueryInterface(IID_PPV_ARG(IPersistFolder2, &pf))))
303 {
304 if (FAILED(pf->GetCurFolder(&m_pidlFolder)))
305 ERR("GetCurFolder failed\n");
306 }
307 TRACE("pidlFolder %p\n", m_pidlFolder);
308 }
309
310 return S_OK;
311}
HANDLE HKEY
Definition: registry.h:26
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define HeapAlloc
Definition: compat.h:733
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
PITEMID_CHILD * _ILCopyaPidl(PCUITEMID_CHILD_ARRAY apidlsrc, UINT cidl)
Definition: pidl.c:2617
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
Definition: pidl.c:237
const PCUITEMID_CHILD * PCUITEMID_CHILD_ARRAY
Definition: shtypes.idl:71
IContextMenuCB * pcmcb
Definition: shlobj.h:2550
IShellFolder * psf
Definition: shlobj.h:2552
PCUITEMID_CHILD_ARRAY apidl
Definition: shlobj.h:2554
const HKEY * aKeys
Definition: shlobj.h:2557
PCIDLIST_ABSOLUTE pidlFolder
Definition: shlobj.h:2551

◆ InvokeCommand()

HRESULT WINAPI CDefaultContextMenu::InvokeCommand ( LPCMINVOKECOMMANDINFO  lpcmi)
override

Implements IContextMenu.

Definition at line 1487 of file CDefaultContextMenu.cpp.

1489{
1490 CMINVOKECOMMANDINFOEX LocalInvokeInfo = {};
1492 UINT CmdId;
1493
1494 /* Take a local copy of the fixed members of the
1495 struct as we might need to modify the verb */
1496 memcpy(&LocalInvokeInfo, lpcmi, min(sizeof(LocalInvokeInfo), lpcmi->cbSize));
1497
1498 /* Check if this is a string verb */
1499 if (!IS_INTRESOURCE(LocalInvokeInfo.lpVerb))
1500 {
1501 /* Get the ID which corresponds to this verb, and update our local copy */
1502 if (MapVerbToCmdId((LPVOID)LocalInvokeInfo.lpVerb, &CmdId, FALSE))
1503 LocalInvokeInfo.lpVerb = MAKEINTRESOURCEA(CmdId);
1504 }
1505
1506 CmdId = LOWORD(LocalInvokeInfo.lpVerb);
1507
1508 if (!m_DynamicEntries.IsEmpty() && CmdId >= m_iIdSHEFirst && CmdId < m_iIdSHELast)
1509 {
1510 LocalInvokeInfo.lpVerb -= m_iIdSHEFirst;
1511 Result = InvokeShellExt(&LocalInvokeInfo);
1512 return Result;
1513 }
1514
1515 if (!m_StaticEntries.IsEmpty() && CmdId >= m_iIdSCMFirst && CmdId < m_iIdSCMLast)
1516 {
1517 LocalInvokeInfo.lpVerb -= m_iIdSCMFirst;
1518 Result = InvokeRegVerb(&LocalInvokeInfo);
1519 // TODO: if (FAILED(Result) && !(lpcmi->fMask & CMIC_MASK_FLAG_NO_UI)) SHELL_ErrorBox(m_pSite, Result);
1520 return Result;
1521 }
1522
1523 if (m_iIdCBFirst != m_iIdCBLast && CmdId >= m_iIdCBFirst && CmdId < m_iIdCBLast)
1524 {
1525 Result = _DoInvokeCommandCallback(&LocalInvokeInfo, CmdId - m_iIdCBFirst);
1526 return Result;
1527 }
1528
1529 if (m_iIdDfltFirst != m_iIdDfltLast && CmdId >= m_iIdDfltFirst && CmdId < m_iIdDfltLast)
1530 {
1531 CmdId -= m_iIdDfltFirst;
1532 /* See the definitions of IDM_CUT and co to see how this works */
1533 CmdId += DCM_FCIDM_SHVIEW_OFFSET;
1534 }
1535
1536 if (LocalInvokeInfo.cbSize >= sizeof(CMINVOKECOMMANDINFOEX) && (LocalInvokeInfo.fMask & CMIC_MASK_PTINVOKE))
1537 {
1538 if (m_pDataObj && FAILED_UNEXPECTEDLY(DataObject_SetOffset(m_pDataObj, &LocalInvokeInfo.ptInvoke)))
1539 {
1540 ERR("Unable to add OFFSET to DataObject!\n");
1541 }
1542 }
1543
1544 /* Check if this is a Id */
1545 switch (CmdId)
1546 {
1548 Result = DoPaste(&LocalInvokeInfo, FALSE);
1549 break;
1551 Result = DoPaste(&LocalInvokeInfo, TRUE);
1552 break;
1553 case FCIDM_SHVIEW_OPEN:
1555 Result = DoOpenOrExplore(&LocalInvokeInfo);
1556 break;
1557 case FCIDM_SHVIEW_COPY:
1558 case FCIDM_SHVIEW_CUT:
1559 Result = DoCopyOrCut(&LocalInvokeInfo, CmdId == FCIDM_SHVIEW_COPY);
1560 break;
1562 Result = DoCreateLink(&LocalInvokeInfo);
1563 break;
1565 Result = DoDelete(&LocalInvokeInfo);
1566 break;
1568 Result = DoRename(&LocalInvokeInfo);
1569 break;
1571 Result = DoProperties(&LocalInvokeInfo);
1572 break;
1574 Result = DoCreateNewFolder(&LocalInvokeInfo);
1575 break;
1577 Result = DoCopyToMoveToFolder(&LocalInvokeInfo, TRUE);
1578 break;
1580 Result = DoCopyToMoveToFolder(&LocalInvokeInfo, FALSE);
1581 break;
1582 case FCIDM_SHVIEW_UNDO:
1583 Result = DoUndo(&LocalInvokeInfo);
1584 break;
1585 default:
1587 ERR("Unhandled Verb %xl\n", LOWORD(LocalInvokeInfo.lpVerb));
1588 break;
1589 }
1590
1591 return Result;
1592}
HRESULT InvokeRegVerb(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT DoRename(LPCMINVOKECOMMANDINFOEX lpcmi)
BOOL MapVerbToCmdId(PVOID Verb, PUINT idCmd, BOOL IsUnicode)
HRESULT DoCreateLink(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT DoUndo(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT DoCopyOrCut(LPCMINVOKECOMMANDINFOEX lpcmi, BOOL bCopy)
HRESULT DoDelete(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT DoCopyToMoveToFolder(LPCMINVOKECOMMANDINFOEX lpici, BOOL bCopy)
HRESULT DoProperties(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT DoCreateNewFolder(LPCMINVOKECOMMANDINFOEX lpici)
HRESULT DoPaste(LPCMINVOKECOMMANDINFOEX lpcmi, BOOL bLink)
HRESULT DoOpenOrExplore(LPCMINVOKECOMMANDINFOEX lpcmi)
HRESULT InvokeShellExt(LPCMINVOKECOMMANDINFOEX lpcmi)
struct IContextMenu::tagCMInvokeCommandInfoEx CMINVOKECOMMANDINFOEX
#define min(a, b)
Definition: monoChain.cc:55
#define FCIDM_SHVIEW_CUT
Definition: shresdef.h:829
#define FCIDM_SHVIEW_OPEN
Definition: shresdef.h:856
#define FCIDM_SHVIEW_UNDO
Definition: shresdef.h:832
#define FCIDM_SHVIEW_COPY
Definition: shresdef.h:830
#define FCIDM_SHVIEW_INSERTLINK
Definition: shresdef.h:833
#define FCIDM_SHVIEW_NEWFOLDER
Definition: shresdef.h:852
#define FCIDM_SHVIEW_EXPLORE
Definition: shresdef.h:855
#define FCIDM_SHVIEW_PROPERTIES
Definition: shresdef.h:828
#define FCIDM_SHVIEW_COPYTO
Definition: shresdef.h:834
#define FCIDM_SHVIEW_MOVETO
Definition: shresdef.h:835
#define FCIDM_SHVIEW_DELETE
Definition: shresdef.h:827
#define FCIDM_SHVIEW_RENAME
Definition: shresdef.h:849
#define FCIDM_SHVIEW_CREATELINK
Definition: shresdef.h:850
#define FCIDM_SHVIEW_INSERT
Definition: shresdef.h:831
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define MAKEINTRESOURCEA(i)
Definition: winuser.h:581
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ InvokePidl()

HRESULT CDefaultContextMenu::InvokePidl ( LPCMINVOKECOMMANDINFOEX  lpcmi,
LPCITEMIDLIST  pidl,
PStaticShellEntry  pEntry 
)
private

Definition at line 1311 of file CDefaultContextMenu.cpp.

1312{
1313 const BOOL unicode = IsUnicode(*lpcmi);
1314
1315 LPITEMIDLIST pidlFull = ILCombine(m_pidlFolder, pidl);
1316 if (pidlFull == NULL)
1317 {
1318 return E_FAIL;
1319 }
1320
1321 WCHAR wszPath[MAX_PATH];
1322 BOOL bHasPath = SHGetPathFromIDListW(pidlFull, wszPath);
1323
1324 WCHAR wszDir[MAX_PATH];
1325
1326 SHELLEXECUTEINFOW sei = { sizeof(sei) };
1327 sei.fMask = SEE_MASK_CLASSKEY | SEE_MASK_IDLIST | (CmicFlagsToSeeFlags(lpcmi->fMask) & ~SEE_MASK_INVOKEIDLIST);
1328 sei.hwnd = lpcmi->hwnd;
1329 sei.nShow = lpcmi->nShow;
1330 sei.lpVerb = pEntry->Verb;
1331 sei.lpIDList = pidlFull;
1332 sei.hkeyClass = pEntry->hkClass;
1333 sei.dwHotKey = lpcmi->dwHotKey;
1334 sei.hIcon = lpcmi->hIcon;
1335 sei.lpDirectory = wszDir;
1336
1337 if (unicode && !StrIsNullOrEmpty(lpcmi->lpDirectoryW))
1338 {
1339 sei.lpDirectory = lpcmi->lpDirectoryW;
1340 }
1341 else if (bHasPath)
1342 {
1343 wcscpy(wszDir, wszPath);
1344 PathRemoveFileSpec(wszDir);
1345 }
1346 else
1347 {
1348 if (!SHGetPathFromIDListW(m_pidlFolder, wszDir))
1349 *wszDir = UNICODE_NULL;
1350 }
1351
1352 if (bHasPath)
1353 sei.lpFile = wszPath;
1354
1355 CComHeapPtr<WCHAR> pszParamsW;
1356 if (unicode && !StrIsNullOrEmpty(lpcmi->lpParametersW))
1357 sei.lpParameters = lpcmi->lpParametersW;
1358 else if (!StrIsNullOrEmpty(lpcmi->lpParameters) && __SHCloneStrAtoW(&pszParamsW, lpcmi->lpParameters))
1359 sei.lpParameters = pszParamsW;
1360
1361 if (!sei.lpClass && (lpcmi->fMask & (CMIC_MASK_HASLINKNAME | CMIC_MASK_HASTITLE)) && unicode)
1362 sei.lpClass = lpcmi->lpTitleW; // Forward .lnk path from CShellLink::DoOpen (for consrv STARTF_TITLEISLINKNAME)
1363
1364 ShellExecuteExW(&sei);
1365 ILFree(pidlFull);
1366
1367 return S_OK;
1368}
#define CmicFlagsToSeeFlags(flags)
Definition: precomp.h:158
void WINAPI ILFree(LPITEMIDLIST pidl)
Definition: pidl.c:946
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
Definition: pidl.c:718
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static __inline LPWSTR __SHCloneStrAtoW(WCHAR **target, const char *source)
Definition: shell32_main.h:168
#define SEE_MASK_CLASSKEY
Definition: shellapi.h:26
#define SEE_MASK_IDLIST
Definition: shellapi.h:27
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2424
#define PathRemoveFileSpec
Definition: shlwapi.h:1035
LPCWSTR lpDirectory
Definition: shellapi.h:334
LPCWSTR lpParameters
Definition: shellapi.h:333

Referenced by InvokeRegVerb().

◆ InvokeRegVerb()

HRESULT CDefaultContextMenu::InvokeRegVerb ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 1371 of file CDefaultContextMenu.cpp.

1373{
1374 INT iCmd = LOWORD(lpcmi->lpVerb);
1375 HRESULT hr;
1376 UINT i;
1377
1378 POSITION it = m_StaticEntries.FindIndex(iCmd);
1379
1380 if (it == NULL)
1381 return E_INVALIDARG;
1382
1384
1385 CRegKey VerbKey;
1386 WCHAR VerbKeyPath[sizeof("shell\\") + MAX_VERB];
1387 hr = StringCbPrintfW(VerbKeyPath, sizeof(VerbKeyPath), L"shell\\%s", pEntry->Verb.GetString());
1388 if (SUCCEEDED(hr) && m_pDataObj &&
1389 VerbKey.Open(pEntry->hkClass, VerbKeyPath, KEY_READ) == ERROR_SUCCESS)
1390 {
1391 CLSID clsid;
1392
1393 DWORD KeyState = 0;
1394 if (lpcmi->fMask & CMIC_MASK_SHIFT_DOWN)
1395 KeyState |= MK_SHIFT;
1396 if (lpcmi->fMask & CMIC_MASK_CONTROL_DOWN)
1397 KeyState |= MK_CONTROL;
1398
1399 POINTL *pPtl = NULL;
1400 C_ASSERT(sizeof(POINT) == sizeof(POINTL));
1401 if (lpcmi->fMask & CMIC_MASK_PTINVOKE)
1402 pPtl = (POINTL*)&lpcmi->ptInvoke;
1403
1405 hr = SHELL_GetRegCLSID(VerbKey, L"command", L"DelegateExecute", clsid);
1406 if (SUCCEEDED(hr))
1407 hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_PPV_ARG(IExecuteCommand, &pEC));
1408 if (SUCCEEDED(hr))
1409 {
1412 return InvokeIExecuteCommandWithDataObject(pEC, pEntry->Verb.GetString(), pPB, m_pDataObj,
1413 lpcmi, static_cast<IContextMenu*>(this));
1414 }
1415
1417 hr = SHELL_GetRegCLSID(VerbKey, L"DropTarget", L"CLSID", clsid);
1418 if (SUCCEEDED(hr))
1419 hr = CoCreateInstance(clsid, NULL, CLSCTX_ALL, IID_PPV_ARG(IDropTarget, &pDT));
1420 if (SUCCEEDED(hr))
1421 {
1424 IUnknown_SetSite(pDT, static_cast<IContextMenu*>(this));
1425 IUnknown_InitializeCommand(pDT, pEntry->Verb.GetString(), pPB);
1426 hr = SHSimulateDrop(pDT, m_pDataObj, KeyState, pPtl, NULL);
1427 IUnknown_SetSite(pDT, NULL);
1428 return hr;
1429 }
1430 }
1431
1432 /* Get the browse flags to see if we need to browse */
1434
1435 for (i=0; i < m_cidl; i++)
1436 {
1437 /* Check if we need to browse */
1438 if (wFlags)
1439 {
1440 hr = TryToBrowse(lpcmi, m_apidl[i], wFlags);
1441 if (SUCCEEDED(hr))
1442 {
1443 /* In WinXP if we have browsed, we don't open any more folders.
1444 * In Win7 we browse to the first folder we find and
1445 * open new windows for each of the rest of the folders */
1447 if (ntver >= _WIN32_WINNT_VISTA)
1448 wFlags = 0; // FIXME: = SBSP_NEWBROWSER | (wFlags & ~SBSP_SAMEBROWSER);
1449 else
1450 i = m_cidl;
1451
1452 continue;
1453 }
1454 }
1455
1456 InvokePidl(lpcmi, m_apidl[i], pEntry);
1457 }
1458
1459 return S_OK;
1460}
static HRESULT SHELL_GetRegCLSID(HKEY hKey, LPCWSTR SubKey, LPCWSTR Value, CLSID &clsid)
LONG Open(HKEY hKeyParent, LPCTSTR lpszKeyName, REGSAM samDesired=KEY_READ|KEY_WRITE) noexcept
Definition: atlbase.h:1173
DWORD BrowserFlagsFromVerb(LPCMINVOKECOMMANDINFOEX lpcmi, PStaticShellEntry pEntry)
HRESULT TryToBrowse(LPCMINVOKECOMMANDINFOEX lpcmi, LPCITEMIDLIST pidl, DWORD wFlags)
HRESULT InvokePidl(LPCMINVOKECOMMANDINFOEX lpcmi, LPCITEMIDLIST pidl, PStaticShellEntry pEntry)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
EXTERN_C HRESULT IUnknown_InitializeCommand(_In_ IUnknown *pUnk, _In_ PCWSTR pszCommandName, _In_opt_ IPropertyBag *pPB)
Definition: utils.cpp:1294
EXTERN_C HRESULT InvokeIExecuteCommandWithDataObject(_In_ IExecuteCommand *pEC, _In_ PCWSTR pszCommandName, _In_opt_ IPropertyBag *pPB, _In_ IDataObject *pDO, _In_opt_ LPCMINVOKECOMMANDINFOEX pICI, _In_opt_ IUnknown *pSite)
Definition: utils.cpp:1348
HRESULT WINAPI SHCreatePropertyBagOnRegKey(HKEY hKey, LPCWSTR subkey, DWORD grfMode, REFIID riid, void **ppv)
Definition: ordinal.c:5193
#define C_ASSERT(e)
Definition: intsafe.h:73
#define STGM_READ
Definition: objbase.h:917
int32_t INT
Definition: typedefs.h:58

Referenced by InvokeCommand().

◆ InvokeShellExt()

HRESULT CDefaultContextMenu::InvokeShellExt ( LPCMINVOKECOMMANDINFOEX  lpcmi)
private

Definition at line 1224 of file CDefaultContextMenu.cpp.

1226{
1227 TRACE("verb %p first %x last %x\n", lpcmi->lpVerb, m_iIdSHEFirst, m_iIdSHELast);
1228
1229 UINT idCmd = LOWORD(lpcmi->lpVerb);
1231 if (!pEntry)
1232 return E_FAIL;
1233
1234 /* invoke the dynamic context menu */
1235 lpcmi->lpVerb = MAKEINTRESOURCEA(idCmd - pEntry->iIdCmdFirst);
1236 return pEntry->pCM->InvokeCommand((LPCMINVOKECOMMANDINFO)lpcmi);
1237}

Referenced by InvokeCommand().

◆ IsShellExtensionAlreadyLoaded()

BOOL CDefaultContextMenu::IsShellExtensionAlreadyLoaded ( REFCLSID  clsid)
private

Definition at line 403 of file CDefaultContextMenu.cpp.

404{
405 POSITION it = m_DynamicEntries.GetHeadPosition();
406 while (it != NULL)
407 {
408 const DynamicShellEntry& info = m_DynamicEntries.GetNext(it);
409 if (info.ClassID == clsid)
410 return TRUE;
411 }
412
413 return FALSE;
414}

Referenced by LoadDynamicContextMenuHandler().

◆ LoadDynamicContextMenuHandler()

HRESULT CDefaultContextMenu::LoadDynamicContextMenuHandler ( HKEY  hKey,
REFCLSID  clsid 
)
private

Definition at line 417 of file CDefaultContextMenu.cpp.

418{
419 HRESULT hr;
420 TRACE("LoadDynamicContextMenuHandler entered with This %p hKey %p pclsid %s\n", this, hKey, wine_dbgstr_guid(&clsid));
421
423 return S_OK;
424
427 if (FAILED(hr))
428 {
429 ERR("SHCoCreateInstance(IContextMenu) failed.clsid %s hr 0x%x\n", wine_dbgstr_guid(&clsid), hr);
430 return hr;
431 }
432
433 CComPtr<IShellExtInit> pExtInit;
434 hr = pcm->QueryInterface(IID_PPV_ARG(IShellExtInit, &pExtInit));
435 if (FAILED(hr))
436 {
437 ERR("IContextMenu->QueryInterface(IShellExtInit) failed.clsid %s hr 0x%x\n", wine_dbgstr_guid(&clsid), hr);
438 return hr;
439 }
440
441 hr = pExtInit->Initialize(m_pDataObj ? NULL : m_pidlFolder, m_pDataObj, hKey);
442 if (FAILED(hr))
443 {
444 WARN("IShellExtInit::Initialize failed.clsid %s hr 0x%x\n", wine_dbgstr_guid(&clsid), hr);
445 return hr;
446 }
447
448 if (m_site)
450
451 m_DynamicEntries.AddTail({ 0, 0, clsid, pcm });
452
453 return S_OK;
454}
BOOL IsShellExtensionAlreadyLoaded(REFCLSID clsid)
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

Referenced by EnumerateDynamicContextHandlerForKey().

◆ MapVerbToCmdId()

BOOL CDefaultContextMenu::MapVerbToCmdId ( PVOID  Verb,
PUINT  idCmd,
BOOL  IsUnicode 
)
private

Definition at line 1191 of file CDefaultContextMenu.cpp.

1192{
1193 WCHAR UnicodeStr[MAX_VERB];
1194
1195 /* Loop through all the static verbs looking for a match */
1196 for (UINT i = 0; i < _countof(g_StaticInvokeCmdMap); i++)
1197 {
1198 /* We can match both ANSI and unicode strings */
1199 if (IsUnicode)
1200 {
1201 /* The static verbs are ANSI, get a unicode version before doing the compare */
1202 SHAnsiToUnicode(g_StaticInvokeCmdMap[i].szStringVerb, UnicodeStr, MAX_VERB);
1203 if (!wcscmp(UnicodeStr, (LPWSTR)Verb))
1204 {
1205 /* Return the Corresponding Id */
1206 *idCmd = g_StaticInvokeCmdMap[i].IntVerb;
1207 return TRUE;
1208 }
1209 }
1210 else
1211 {
1212 if (!strcmp(g_StaticInvokeCmdMap[i].szStringVerb, (LPSTR)Verb))
1213 {
1214 *idCmd = g_StaticInvokeCmdMap[i].IntVerb;
1215 return TRUE;
1216 }
1217 }
1218 }
1219
1220 return FALSE;
1221}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
char * LPSTR
Definition: xmlstorage.h:182

Referenced by InvokeCommand().

◆ QueryContextMenu()

HRESULT WINAPI CDefaultContextMenu::QueryContextMenu ( HMENU  hMenu,
UINT  indexMenu,
UINT  idCmdFirst,
UINT  idCmdLast,
UINT  uFlags 
)
override

Implements IContextMenu.

Definition at line 822 of file CDefaultContextMenu.cpp.

828{
829 HRESULT hr;
830 UINT idCmdNext = idCmdFirst;
831 UINT cIds = 0;
832
833 TRACE("BuildShellItemContextMenu entered\n");
834
835 /* Load static verbs and shell extensions from registry */
836 for (UINT i = 0; i < m_cKeys && !(uFlags & CMF_NOVERBS); i++)
837 {
840 }
841
842 /* Add static context menu handlers */
843 cIds = AddStaticContextMenusToMenu(hMenu, &IndexMenu, idCmdFirst, idCmdLast, uFlags);
844 m_iIdSCMFirst = 0; // FIXME: This should be = idCmdFirst?
845 m_iIdSCMLast = cIds;
846 idCmdNext = idCmdFirst + cIds;
847
848 /* Add dynamic context menu handlers */
849 cIds += AddShellExtensionsToMenu(hMenu, &IndexMenu, idCmdNext, idCmdLast, uFlags);
851 m_iIdSHELast = cIds;
852 idCmdNext = idCmdFirst + cIds;
853 TRACE("SH_LoadContextMenuHandlers first %x last %x\n", m_iIdSHEFirst, m_iIdSHELast);
854
855 /* Now let the callback add its own items */
856 QCMINFO qcminfo = {hMenu, IndexMenu, idCmdNext, idCmdLast, NULL};
858 {
859 UINT added = qcminfo.idCmdFirst - idCmdNext;
860 cIds += added;
861 IndexMenu += added;
863 m_iIdCBLast = cIds;
864 idCmdNext = idCmdFirst + cIds;
865 }
866
867 //TODO: DFM_MERGECONTEXTMENU_BOTTOM
868
869 UINT idDefaultOffset = 0;
870 BOOL isBackgroundMenu = !m_cidl;
871 if (!(uFlags & CMF_VERBSONLY) && !isBackgroundMenu)
872 {
873 /* Get the attributes of the items */
874 SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
875 hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg);
877 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, cIds);
878
879 /* Add the default part of the menu */
880 HMENU hmenuDefault = LoadMenuW(_AtlBaseModule.GetResourceInstance(), L"MENU_SHV_FILE");
881
882 /* Remove uneeded entries */
883 if (!(rfg & SFGAO_CANMOVE))
884 DeleteMenu(hmenuDefault, IDM_CUT, MF_BYCOMMAND);
885 if (!(rfg & SFGAO_CANCOPY))
886 DeleteMenu(hmenuDefault, IDM_COPY, MF_BYCOMMAND);
887 if (!((rfg & SFGAO_FILESYSTEM) && HasClipboardData()))
888 DeleteMenu(hmenuDefault, IDM_INSERT, MF_BYCOMMAND);
889 if (!(rfg & SFGAO_CANLINK))
890 DeleteMenu(hmenuDefault, IDM_CREATELINK, MF_BYCOMMAND);
891 if (!(rfg & SFGAO_CANDELETE))
892 DeleteMenu(hmenuDefault, IDM_DELETE, MF_BYCOMMAND);
893 if (!(rfg & SFGAO_CANRENAME) || !(uFlags & CMF_CANRENAME))
894 DeleteMenu(hmenuDefault, IDM_RENAME, MF_BYCOMMAND);
895 if (!(rfg & SFGAO_HASPROPSHEET))
896 DeleteMenu(hmenuDefault, IDM_PROPERTIES, MF_BYCOMMAND);
897
898 idDefaultOffset = idCmdNext;
899 UINT idMax = Shell_MergeMenus(hMenu, GetSubMenu(hmenuDefault, 0), IndexMenu, idCmdNext, idCmdLast, 0);
900 m_iIdDfltFirst = cIds;
901 cIds += idMax - idCmdNext;
902 m_iIdDfltLast = cIds;
903
904 DestroyMenu(hmenuDefault);
905 }
906
907 TryPickDefault(hMenu, idCmdFirst, idDefaultOffset, uFlags);
908
909 // TODO: DFM_MERGECONTEXTMENU_TOP
910
911 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, cIds);
912}
static BOOL HasClipboardData()
#define IDM_PROPERTIES
Definition: resources.h:9
UINT AddShellExtensionsToMenu(HMENU hMenu, UINT *pIndexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
UINT AddStaticContextMenusToMenu(HMENU hMenu, UINT *IndexMenu, UINT iIdCmdFirst, UINT iIdCmdLast, UINT uFlags)
BOOL EnumerateDynamicContextHandlerForKey(HKEY hRootKey)
void TryPickDefault(HMENU hMenu, UINT idCmdFirst, UINT DfltOffset, UINT uFlags)
void AddStaticEntriesForKey(HKEY hKey, UINT uFlags)
#define DFM_MERGECONTEXTMENU
Definition: precomp.h:44
#define MAKE_HRESULT(sev, fac, code)
Definition: dmerror.h:30
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
Definition: ebrowser.c:83
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
UINT WINAPI Shell_MergeMenus(HMENU hmDst, HMENU hmSrc, UINT uInsert, UINT uIDAdjust, UINT uIDAdjustMax, ULONG uFlags)
Definition: shlmenu.c:856
#define IDM_DELETE
Definition: shresdef.h:869
#define IDM_INSERT
Definition: shresdef.h:867
#define IDM_RENAME
Definition: shresdef.h:870
#define IDM_COPY
Definition: shresdef.h:866
#define IDM_CUT
Definition: shresdef.h:865
#define IDM_CREATELINK
Definition: shresdef.h:868
UINT idCmdFirst
Definition: shlobj.h:1392
#define SEVERITY_SUCCESS
Definition: winerror.h:64
#define MF_BYCOMMAND
Definition: winuser.h:202
BOOL WINAPI DeleteMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
BOOL WINAPI DestroyMenu(_In_ HMENU)
HMENU WINAPI LoadMenuW(_In_opt_ HINSTANCE, _In_ LPCWSTR)

◆ QueryService()

virtual HRESULT STDMETHODCALLTYPE CDefaultContextMenu::QueryService ( REFGUID  svc,
REFIID  riid,
void **  ppv 
)
inlinevirtual

Implements IServiceProvider.

Definition at line 208 of file CDefaultContextMenu.cpp.

209 {
210 return IUnknown_QueryService(m_site, svc, riid, ppv);
211 }
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ SetSite()

HRESULT WINAPI CDefaultContextMenu::SetSite ( IUnknown pUnkSite)
override

Implements IObjectWithSite.

Definition at line 1775 of file CDefaultContextMenu.cpp.

1776{
1777 m_site = pUnkSite;
1778 return S_OK;
1779}

◆ TryPickDefault()

void CDefaultContextMenu::TryPickDefault ( HMENU  hMenu,
UINT  idCmdFirst,
UINT  DfltOffset,
UINT  uFlags 
)
private

Definition at line 786 of file CDefaultContextMenu.cpp.

787{
788 // Are we allowed to pick a default?
789 if ((uFlags & CMF_NODEFAULT) ||
790 ((uFlags & CMF_DONOTPICKDEFAULT) && RosGetProcessEffectiveVersion() >= _WIN32_WINNT_WIN7))
791 {
792 return;
793 }
794
795 // Do we already have a default?
796 if ((int)GetMenuDefaultItem(hMenu, MF_BYPOSITION, 0) != -1)
797 return;
798
799 // Does the view want to pick one?
800 INT_PTR forceDfm = 0;
801 if (SUCCEEDED(_DoCallback(DFM_GETDEFSTATICID, 0, &forceDfm)) && forceDfm)
802 {
803 for (UINT i = 0; i < _countof(g_StaticInvokeCmdMap); ++i)
804 {
805 UINT menuItemId = g_StaticInvokeCmdMap[i].IntVerb + DfltOffset - DCM_FCIDM_SHVIEW_OFFSET;
806 if (g_StaticInvokeCmdMap[i].DfmCmd == forceDfm &&
807 SetMenuDefaultItem(hMenu, menuItemId, MF_BYCOMMAND))
808 {
809 return;
810 }
811 }
812 }
813
814 // Don't want to pick something like cut or delete as the default but
815 // a static or dynamic verb is a good default.
817 SetMenuDefaultItem(hMenu, idCmdFirst, MF_BYCOMMAND);
818}
#define DFM_GETDEFSTATICID
Definition: precomp.h:47
int32_t INT_PTR
Definition: typedefs.h:64
UINT WINAPI GetMenuDefaultItem(_In_ HMENU hMenu, _In_ UINT fByPos, _In_ UINT gmdiFlags)
BOOL WINAPI SetMenuDefaultItem(_In_ HMENU, _In_ UINT, _In_ UINT)
#define MF_BYPOSITION
Definition: winuser.h:203

Referenced by QueryContextMenu().

◆ TryToBrowse()

HRESULT CDefaultContextMenu::TryToBrowse ( LPCMINVOKECOMMANDINFOEX  lpcmi,
LPCITEMIDLIST  pidl,
DWORD  wFlags 
)
private

Definition at line 1286 of file CDefaultContextMenu.cpp.

1288{
1290 HRESULT hr;
1291
1292 if (!m_site)
1293 return E_FAIL;
1294
1295 /* Get a pointer to the shell browser */
1297 if (FAILED(hr))
1298 return hr;
1299
1300 PIDLIST_ABSOLUTE pidl;
1301 hr = SHILCombine(m_pidlFolder, pidlChild, &pidl);
1303 return hr;
1304
1305 hr = psb->BrowseObject(pidl, wFlags & ~SBSP_RELATIVE);
1306 ILFree(pidl);
1307 return hr;
1308}

Referenced by InvokeRegVerb().

Member Data Documentation

◆ m_aKeys

HKEY* CDefaultContextMenu::m_aKeys
private

Definition at line 142 of file CDefaultContextMenu.cpp.

Referenced by Initialize(), QueryContextMenu(), and ~CDefaultContextMenu().

◆ m_apidl

PCUITEMID_CHILD_ARRAY CDefaultContextMenu::m_apidl
private

◆ m_bGroupPolicyActive

DWORD CDefaultContextMenu::m_bGroupPolicyActive
private

Definition at line 145 of file CDefaultContextMenu.cpp.

Referenced by EnumerateDynamicContextHandlerForKey().

◆ m_cidl

UINT CDefaultContextMenu::m_cidl
private

◆ m_cKeys

UINT CDefaultContextMenu::m_cKeys
private

Definition at line 143 of file CDefaultContextMenu.cpp.

Referenced by Initialize(), QueryContextMenu(), and ~CDefaultContextMenu().

◆ m_DefVerbs

WCHAR CDefaultContextMenu::m_DefVerbs[MAX_PATH]
private

◆ m_DynamicEntries

◆ m_hwnd

HWND CDefaultContextMenu::m_hwnd
private

Definition at line 156 of file CDefaultContextMenu.cpp.

Referenced by _DoCallback(), and Initialize().

◆ m_iIdCBFirst

UINT CDefaultContextMenu::m_iIdCBFirst
private

Definition at line 152 of file CDefaultContextMenu.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_iIdCBLast

UINT CDefaultContextMenu::m_iIdCBLast
private

Definition at line 153 of file CDefaultContextMenu.cpp.

Referenced by InvokeCommand(), and QueryContextMenu().

◆ m_iIdDfltFirst

UINT CDefaultContextMenu::m_iIdDfltFirst
private

Definition at line 154 of file CDefaultContextMenu.cpp.

Referenced by GetCommandString(), InvokeCommand(), and QueryContextMenu().

◆ m_iIdDfltLast

UINT CDefaultContextMenu::m_iIdDfltLast
private

◆ m_iIdSCMFirst

UINT CDefaultContextMenu::m_iIdSCMFirst
private

◆ m_iIdSCMLast

UINT CDefaultContextMenu::m_iIdSCMLast
private

◆ m_iIdSHEFirst

UINT CDefaultContextMenu::m_iIdSHEFirst
private

◆ m_iIdSHELast

UINT CDefaultContextMenu::m_iIdSHELast
private

◆ m_pDataObj

◆ m_pfnmcb

LPFNDFMCALLBACK CDefaultContextMenu::m_pfnmcb
private

Definition at line 138 of file CDefaultContextMenu.cpp.

Referenced by _DoCallback(), and Initialize().

◆ m_pidlFolder

◆ m_pmcb

CComPtr<IContextMenuCB> CDefaultContextMenu::m_pmcb
private

Definition at line 137 of file CDefaultContextMenu.cpp.

Referenced by _DoCallback(), and Initialize().

◆ m_psf

CComPtr<IShellFolder> CDefaultContextMenu::m_psf
private

◆ m_site

◆ m_StaticEntries


The documentation for this class was generated from the following file: