Platform SDK: Active Directory, ADSI, and Directory Services

_BrowseCallBack

The _BrowseCallBack function is a callback function implemented by the caller of the function to handle relevant messages (see the msg parameter for a list of messages) dispatched from the browse dialog, for example, to override some default behavior, or to provide extra filtering.

int CALLBACK _BrowseCallBack(
  HWND hwnd,
  UINT msg,
  LPARAM lpData,
  LPARAM lParam
);

Parameters

hwnd
[in] Window handle of the browse dialog, used for sending messages.
msg
[in] One of the following browse messages.
Message Description
DSBM_CHANGEIMAGESTATE Called before the image state in the tree view is changed.
DSBM_CONTEXTMENU Used to forward WM_CONTEXTMENU messages from the dialog to the callback function.
DSBM_HELP Used to forward the WM_HELP message from the dialog to the callback function.
DSBM_QUERYINSERT Called before each item is inserted into the tree view, which allows the caller to override the display information for a particular node, including its display name, icon, and so on.

lpData
[in] Message-specific data.
lParam
[in] Calls back specific information, as stored in DSBROWSEINFO.

Return Values

The function should return TRUE if it handles the message, FALSE if it ignores the message.

Remarks

You must declare and implement a callback function following the prototype discussed above. You specify the callback function in the pfnCallback field of the DSBROWSEINFO structure.

Upon receiving a DSBM_QUERYINSERT message, the callback function can modify the structure and update any of the fields before returning to the caller. If the structure has been modified, the callback function should return TRUE. An item will be hidden when the callback function sets the DSBS_HIDDEN flag and returns TRUE.

The DSBM_HELP message uses the lpData parameter to receive lParam from WM_HELP. The DSBM_CONTEXTMENU uses the lpData parameter to receive wParam from WM_CONTEXTMENU.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Dsclient.h.

See Also

DsBrowseForContainer, DSBROWSEINFO