BrowseCallbackProc (Compact 2013)
3/28/2014
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.Message
Description
Indicates that the Browse For Folder dialog box finished initializing. The value of the lParam parameter for the BrowseCallbackProc function is zero.
Indicates 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.
Indicates 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 Value
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.
Message |
Description |
---|---|
Enables 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. |
|
Selects 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. |
|
Sets the status text. Set the lParam value of this message to point to a NULL-terminated string that contains the desired text. |
Requirements
Header |
shlobj.h |
Library |
ceshell.lib |
See Also
Reference
Shell Functions
SHBrowseForFolder
BFFM_ENABLEOK
BFFM_INITIALIZED
BFFM_SELCHANGED
BFFM_SETSELECTION
BFFM_SETSTATUSTEXT
BFFM_VALIDATEFAILED
BROWSEINFO
ITEMIDLIST