Export (0) Print
Expand All

BrowseCallbackProc (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function specifies an application-defined callback function used with the SHBrowseForFolder function. The Browse For Folder dialog box calls this function to notify the application about events.

Syntax

int CALLBACK BrowseCallbackProc(
  HWND hwnd,
  UINT uMsg,
  LPARAM lParam,
  LPARAM lpData
);

Parameters

hwnd
[in] Handle to the Browse For Folder dialog box.
uMsg
[in] Unsigned integer that specifies the event. The following table shows the possible values.
MessageDescription
BFFM_INITIALIZEDIndicates that the Browse For Folder dialog box finished initializing. The value of the lParam parameter for the BrowseCallbackProc function is zero.
BFFM_SELCHANGEDIndicates that the selection in the dialog box changed. The lParam parameter for the BrowseCallbackProc function is a pointer to the ITEMIDLIST structure (PIDL) for the newly selected item.
BFFM_VALIDATEFAILEDIndicates that the user typed an invalid name into the edit box of the Browse For Folder dialog box. The lParam parameter for the BrowseCallbackProc function is a pointer to a character buffer that contains the invalid name. An application can use this message to inform the user that the name entered is not valid. Return zero to dismiss the dialog box or a nonzero value to continue displaying the dialog box.
lParam
[in] Value that depends on the message contained in the uMsg parameter.
lpData
[in] Application-defined value that was specified in the lParam member of the BROWSEINFO structure that was passed to SHBrowseForFolder.

Return Values

This function always returns zero.

Remarks

You can use the window handle in the hwnd parameter to send messages to a dialog box within your implementation of BrowseCallbackProc. The following table shows the messages that you can send.

MessageDescription
BFFM_ENABLEOKEnables or disables the OK button for the Browse For Folder dialog box. To enable the OK button, set the lParam parameter for this message to a nonzero value. To disable the OK button, set lParam for this message to zero.
BFFM_SETSELECTIONSelects the specified folder. To use a pointer to an ITEMIDLIST structure (PIDL) to specify the folder, set lParam for this message to the PIDL and set wParam to FALSE. To specify the path to the folder, set the lParam value of the message to point to a NULL-terminated string that contains the path and set wParam to TRUE.
BFFM_SETSTATUSTEXTSets the status text. Set the lParam value of this message to point to a NULL-terminated string that contains the desired text.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Shlobj.h.
Link Library: Ceshell.lib.

See Also

Standard Shell Functions | SHBrowseForFolder | BFFM_ENABLEOK | BFFM_INITIALIZED | BFFM_SELCHANGED | BFFM_SETSELECTION | BFFM_SETSTATUSTEXT | BFFM_VALIDATEFAILED | BROWSEINFO | ITEMIDLIST


Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft