LPFNDFMCALLBACK callback function (shlobj_core.h)

[LPFNDFMCALLBACK is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions.]

Defines the prototype for the callback function that receives messages from the Shell's default context menu implementation.

Syntax

LPFNDFMCALLBACK Lpfndfmcallback;

HRESULT Lpfndfmcallback(
  [in, optional] IShellFolder *psf,
  [in, optional] HWND hwnd,
  [in, optional] IDataObject *pdtobj,
                 UINT uMsg,
                 WPARAM wParam,
                 LPARAM lParam
)
{...}

Parameters

[in, optional] psf

Type: IShellFolder*

A pointer to the IShellFolder object the message applies to. This value can be NULL.

[in, optional] hwnd

Type: HWND

The handle of the window that contains the view. This value can be NULL.

[in, optional] pdtobj

Type: IDataObject*

IDataObject that represents the selection the context menu is based on. This value can be NULL.

uMsg

Type: UINT

One of the following notifications.

Notification Usage
DFM_MERGECONTEXTMENU Sent by the default context menu implementation to allow LPFNDFMCALLBACK to add items to the menu.
DFM_INVOKECOMMAND Sent by the default context menu implementation to request LPFNDFMCALLBACK to invoke a menu command.
DFM_GETDEFSTATICID Sent by the default context menu implementation when the default menu command is being created, allowing an alternate choice to be made.

wParam

Type: WPARAM

Additional information. See the individual notification pages for specific requirements.

lParam

Type: LPARAM

Additional information. See the individual notification pages for specific requirements.

Return value

Type: HRESULT

Returns S_OK if the message was handled, or an error value otherwise, including the following:

Return code Description
E_NOTIMPL
The message was not handled.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header shlobj_core.h (include Shlobj.h)