BrowseCallbackProc

Specifies an application-defined callback function used with the SHBrowseForFolder function. The browse dialog box calls this function to notify it about events.



int CALLBACK BrowseCallbackProc(

    HWND hwnd, 

    UINT uMsg, 

    LPARAM lParam, 

    LPARAM lpData

    );

Parameters

hwnd
Window handle to the browse dialog box. BrowseCallbackProc can use this handle to send the following messages to the dialog box:
BFFM_ENABLEOK
Enables or disables the browse dialog box's OK button. To enable the OK button, set the message's lParam to a nonzero value. To disable the OK button, set message's lParam to zero.
BFFM_SETSELECTION
Selects the specified folder. To use a PIDL to specify the folder, set the message's lParam to the PIDL, and set wParam to FALSE. To specify the folder's path, set the message's lParam value to point to a NULL-terminated string with the path, and set wParam to TRUE.
BFFM_SETSTATUSTEXT
Sets the status text. Set the message's lParam value to point to a NULL-terminated string with the desired text.
uMsg
Value identifying the event. This can be one of the following values:
BFFM_INITIALIZED
Indicates the browse dialog box has finished initializing. The lParam value is zero.
BFFM_SELCHANGED
Indicates the selection has changed. The lParam parameter points to the item identifier list for the newly selected item.
BFFM_VALIDATEFAILED
Version 4.71. Indicates the user typed an invalid name into the edit box of the browse dialog. The lParam parameter is the address of a character buffer that contains the invalid name. An application can use this message to inform the user that the name entered was not valid. Return zero to allow the dialog to be dismissed or nonzero to keep the dialog displayed.
lParam
Value dependent upon the message contained in the uMsg parameter.
lpData
Application-defined value that was specified in the lParam member of the BROWSEINFO structure.

Return Values

Returns zero.

See Also

SHBrowseForFolder

Requirements

  Version 4.00 and later of Shell32.dll

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in shlobj.h.
  Import Library: user-defined.