CB_DIR message

Adds names to the list displayed by the combo box. The message adds the names of directories and files that match a specified string and set of file attributes. CB_DIR can also add mapped drive letters to the list.

Parameters

wParam

The attributes of the files or directories to be added to the combo box. This parameter can be one or more of the following values.

ValueMeaning
DDL_ARCHIVE

Includes archived files.

DDL_DIRECTORY

Includes subdirectories, which are enclosed in square brackets ([ ]).

DDL_DRIVES

All mapped drives are added to the list. Drives are listed in the form [-x-], where x is the drive letter.

DDL_EXCLUSIVE

Includes only files with the specified attributes. By default, read/write files are listed even if DDL_READWRITE is not specified.

DDL_HIDDEN

Includes hidden files.

DDL_READONLY

Includes read-only files.

DDL_READWRITE

Includes read/write files with no additional attributes. This is the default.

DDL_SYSTEM

Includes system files.

 

lParam

An LPCTSTR pointer to a null-terminated string that specifies an absolute path, relative path, or file name. An absolute path can begin with a drive letter (for example, d:\) or a UNC name (for example, \\machinename\sharename). If the string specifies a file name or directory that has the attributes specified by the wParam parameter, the file name or directory is added to the list. If the file name or directory name contains wildcard characters (? or *), all files or directories that match the wildcard expression and have the attributes specified by the wParam parameter are added to the list displayed in the combo box.

Return value

If the message succeeds, the return value is the zero-based index of the last name added to the list.

If an error occurs, the return value is CB_ERR. If there is insufficient space to store the new strings, the return value is CB_ERRSPACE.

Remarks

Windows NT 4.0 and later: If wParam includes the DDL_DIRECTORY flag and lParam specifies all the subdirectories of a first-level directory, such as C:\TEMP\*, the list box will always include a ".." entry for the root directory. This is true even if the root directory has hidden or system attributes and the DDL_HIDDEN and DDL_SYSTEM flags are not specified. The root directory of an NTFS volume has hidden and system attributes.

Windows NT/2000/XP: The list displays long file names, if any.

Windows 95/98/Me: The list displays short file names (the 8.3 form). You can use the SHGetFileInfo or GetFullPathName function to get the corresponding long file name.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

See also

Reference
CB_ADDSTRING
CB_INSERTSTRING
DlgDirListComboBox

 

 

Community Additions

ADD
Show:
© 2014 Microsoft