IContextMenuCB::CallBack method

Enables the callback function for a context menu.

Syntax


HRESULT CallBack(
  [in]           IShellFolder *psf,
  [in, optional] HWND         hwndOwner,
  [in]           IDataObject  *pdtobj,
  [in]           UINT         uMsg,
  [in]           WPARAM       wParam,
  [in]           LPARAM       lParam
);

Parameters

psf [in]

Type: IShellFolder*

A pointer to the IShellFolder interface of the object that supports the IContextMenuCB::CallBack interface. The context menu interface is returned on a call to GetUIObjectOf.

hwndOwner [in, optional]

Type: HWND

A handle to the owner of the context menu. This value can be NULL.

pdtobj [in]

Type: IDataObject*

A pointer to an IDataObject that contains information about a menu selection. Implement interface IDataObject, or call SHCreateDataObject for the default implementation.

uMsg [in]

Type: UINT

A notification from the Shell's default menu implementation. For example, the default menu implementation calls DFM_MERGECONTEXTMENU to allow the implementer of IContextMenuCB::CallBack to remove, add, or disable context menu items in this callback. Use one of the following notifications.

DFM_MERGECONTEXTMENU
DFM_INVOKECOMMAND
DFM_GETHELPTEXT
DFM_GETHELPTEXTW
DFM_WM_MEASUREITEM
DFM_WM_DRAWITEM
DFM_WM_INITMENUPOPUP
DFM_VALIDATECMD
DFM_INVOKECOMMANDEX
DFM_MAPCOMMANDNAME
DFM_GETDEFSTATICID
DFM_GETVERB
DFM_MERGECONTEXTMENU_BOTTOM

 

wParam [in]

Type: WPARAM

Data specific to the notification specified in uMsg. See the individual notification page for specific requirements.

lParam [in]

Type: LPARAM

Data specific to the notification specified in uMsg. See the individual notification page for specific requirements.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

See also

IContextMenuCB
Creating Context Menu Handlers

 

 

Show: