Windows API Guide: Reference: Functions


Public Function BrowseCallbackProc(ByVal hwnd As Long, ByVal uMsg As Long, ByVal lParam As Long, ByVal lpData As Long) As Long   ' application-defined code goes here End Function

Description & Usage

The BrowseCallbackProc callback function process the messages of a Browse for Folder dialog box. Specifically, this function responds to the messages notifying when the dialog box is being initialized and when the user as changed the current selection. This function does not necessarily have to be called BrowseCallbackProc; that is merely the name given to it in discussions about the API. The callback function can work with the dialog box by sending it one of the following messages via SendMessage:

BFFM_ENABLEOK
Enable or disable the dialog box's OK button. To enable the OK button, set the lParam message parameter to a non-zero value. To disable the OK button, set the lParam message parameter to 0.
BFFM_SETSELECTION
Set the current selection in the dialog box. To specify the desired path using a string, set the lParam message parameter to the string and the wParam message parameter to a non-zero value. To specify the desired path using a pointer to an ITEMIDLIST structure (a.k.a. a PIDL), set the lParam message parameter to the PIDL and the wParam message parameter to 0.
BFFM_SETSTATUSTEXT
Set the status text displayed by the dialog box, if it exists. Set the lParam message parameter to the string holding the desired text.

Return Value

The function always returns 0, unless the dialog box is processing the BFFM_VALIDATEFAILED message (see that message's description below for details).

Visual Basic-Specific Issues

Like all callback functions, BrowseCallbackProc must be declared Public within a module.

Parameters

hwnd
A handle to the Browse for Folder dialog box calling this function. This handle is necessary to send messages back to the dialog box.
uMsg
One of the following flags specifying the event:
BFFM_INITIALIZED
The dialog box has just finished initializing. lParam is 0.
BFFM_SELCHANGED
The user has changed the current selection. lParam is a PIDL to the current selection.
BFFM_VALIDATEFAILED
With Internet Explorer 4.0 or later: The user has typed an invalid path into the edit box. lParam is a pointer to a null-terminated string holding the invalid path name. The function should return 0 to close the dialog box, or a non-zero value to keep it displayed.
lParam
Depends on the value of uMsg.
lpData
The application-defined value given in the BROWSEINFO structure used to create the dialog box.

Constant Definitions

Const BFFM_ENABLEOK = &H465 Const BFFM_SETSELECTION = &H466 Const BFFM_SETSTATUSTEXT = &H464 Const BFFM_INITIALIZED = 1 Const BFFM_SELCHANGED = 2 Const BFFM_VALIDATEFAILED = 3

Used By

BROWSEINFO

Go back to the Callback Function listing.
Go back to the Reference section index.


Last Modified: September 24, 1999
This page is copyright © 1999 Paul Kuliniewicz. Copyright Information Revised October 29, 2000
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/b/browsecallbackproc.html



Windows API Guide
Windows API Guide - Reference - Volume 1: Version 3.0 For the MS-DOS and PC-DOS Operating Systems
ISBN: B001V0KQIY
EAN: N/A
Year: 1998
Pages: 610

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net