Windows API Guide: Reference: Functions


Type BROWSEINFO   hwndOwner As Long   pidlRoot As Long   pszDisplayName As String   lpszTitle As String   ulFlags As Long   lpfn As Long   lParam As Long   iImage As Long End Type

Description & Usage

The BROWSEINFO structure holds information used to create the Windows shell's Browse for Folder dialog box. This structure also receives some information regarding the user's final selection.

Visual Basic-Specific Issues

Because of a quirk in Visual Basic syntax, the AddressOf operator cannot be used directly to set the lpfn parameter to a pointer to a callback function. Since the AddressOf operator is only legal within a function call, a "dummy function" must be defined by the program which simply returns the value passed to it. See the example for SHBrowseForFolder to see how this can be done.

Data Members

hwndOwner
A handle to the window opening the dialog box.
pidlRoot
A pointer to an ITEMIDLIST structure (a.k.a. a PIDL) which identifies the root folder for the dialog box. The user's selection is limited to this folder and any subfolders under it.
pszDisplayName
Receives the null-terminated display name of the folder the user selects. This must be initialized to an empty string of at least 260 characters.
lpszTitle
The title of the dialog box, which will appear above the folder tree.
ulFlags
A combination of the following flags specifying additional options for the dialog box:
BIF_BROWSEFORCOMPUTER
Only allow the user to select a computer.
BIF_BROWSEFORPRINTER
Only allow the user to select a printer.
BIF_BROWSEINCLUDEFILES
With Internet Explorer 4.0 or later installed: Display files as well as folders in the tree.
BIF_DONTGOBELOWDOMAIN
Do not display network folders below the current domain level in the folder tree.
BIF_EDITBOX
With Internet Explorer 4.0 or later installed: Display an edit box above the folder tree allowing the user to directly enter the path of the folder to select.
BIF_RETURNFSANCESTORS
Only allow the user to select a file system ancestor.
BIF_RETURNONLYFSDIRS
Only allow the user to select a file system directory.
BIF_STATUSTEXT
Display an area for status text, which can be set by the callback function, above the folder tree.
BIF_USENEWUI
Windows 2000: Use the new user interface design of the dialog box. The new design includes a larger, resizable dialog box; drag and drop capability; reordering; context menus; and new folder creation, deletion, and other context menu commands.
BIF_VALIDATE
With Internet Explorer 4.0 or later installed: If the user types an invalid path into the edit box, send the BFFM_VALIDATEFAILED message to the callback function so it can alert the user.
lpfn
A pointer to the BrowseCallbackProc callback function used to process the dialog box's messages. To use the default behavior, set this to 0.
lParam
An application-defined value to pass to the callback function, if needed.
iImage
Receives the index of the system image associated with the user's selection.

Constant Definitions

Const BIF_BROWSEFORCOMPUTER = &H1000 Const BIF_BROWSEFORPRINTER = &H2000 Const BIF_BROWSEINCLUDEFILES = &H4000 Const BIF_DONTGOBELOWDOMAIN = &H2 Const BIF_EDITBOX = &H10 Const BIF_RETURNFSANCESTORS = &H8 Const BIF_RETURNONLYFSDIRS = &H1 Const BIF_STATUSTEXT = &H4 Const BIF_USENEWUI = &H40 Const BIF_VALIDATE = &H20

Used By

SHBrowseForFolder

Go back to the alphabetical Structure listing.
Go back to the Reference section index.


Last Modified: September 22, 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/browseinfo.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