Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The following C++ code snippet demonstrates the structure of the shortcut menu extension component class definition.
class CMyComp : public IContextMenu, IObjectWithSite
{
public:
CMyComp(); // Constructor.
~CMyComp(); // Destructor.
// IUnknown methods.
STDMETHOD (QueryInterface) (REFIID riid, LPVOID *ppv);
STDMETHOD_(ULONG, AddRef) (void);
STDMETHOD_(ULONG Release) (void);
// IContextMenu methods.
STDMETHOD (GetCommandString) (UINT idCmd, UINT uFlags,
UINT *pwReserved,LPSTR pszName, UINT cchMx);
STDMETHOD (InvokeCommand) (LPCMINVOKECOMMANDINFO pici);
STDMETHOD (QueryContextMenu) (hmenu, UINT indexMenu,
UINT idCmdFirs, UINT idCmdLast, UINT uFlags);
// IObjectWithSite methods.
STDMETHOD (GetSite) (REFIID riid, void **ppvSite);
STDMETHOD (SetSite) (IUnknown *pUnkSite);
// CMyComp methods.
// None.
protected:
ULONG m_cRef; // Reference count.
IUnknown m_punkSite; // Site (owner) pointer.
};
See Also
How to: Register a File System Shortcut Menu
Send feedback on this topic to the authors.
© 2005 Microsoft Corporation. All rights reserved.