int DlgDirListComboBox(hwndDlg, lpszPath, idComboBox, idStaticPath, uFileType) | |||||
HWND hwndDlg; | /* handle of dialog box with combo box | */ | |||
LPSTR lpszPath; | /* address of path or filename string | */ | |||
int idComboBox; | /* identifier of combo box | */ | |||
int idStaticPath; | /* identifier of static control | */ | |||
UINT uFileType; | /* file attributes to display | */ |
The DlgDirListComboBox function fills the list box of a combo box with a file or directory listing. It fills the list box with the names of all files matching the specified path and filename.
hwndDlg
Identifies the dialog box that contains the combo box.
lpszPath
Points to a null-terminated string that contains the path and filename. For more information, see the following Comments section.
idComboBox
Specifies the identifier of a combo box in a dialog box. If this parameter is zero, DlgDirListComboBox assumes that no combo box exists and does not attempt to fill one.
idStaticPath
Specifies the identifier of the static control used for displaying the current drive and directory. If this parameter is zero, DlgDirListComboBox assumes that no such control is present.
uFileType
Specifies the attributes of the filenames to be displayed. This parameter can be a combination of the following values:
Value | Meaning |
DDL_READWRITE | Read-write data files with no additional attributes. |
DDL_READONLY | Read-only files. |
DDL_HIDDEN | Hidden files. |
DDL_SYSTEM | System files. |
DDL_DIRECTORY | Directories. |
DDL_ARCHIVE | Archives. |
DDL_POSTMSGS | CB_DIR flag. If the CB_DIR flag is set, Windows places the messages generated by DlgDirListComboBox in the application's queue; otherwise, they are sent directly to the dialog box procedure. |
DDL_DRIVES | Drives. |
DDL_EXCLUSIVE | Exclusive bit. If the exclusive bit is set, only files of the specified type are listed; otherwise, files of the specified type are listed in addition to normal files. |
The return value is nonzero if the function is successful. Otherwise, it is zero.
The DlgDirListComboBox function shows directories enclosed in brackets ([ ]) and shows drives in the form [-x-], where x is the drive letter.
The lpszPath parameter has the following form:
[drive:][[\]directory[\directory] . . . \][filename]
In this example, drive is a drive letter, directory is a valid MS-DOS directory name, and filename is a valid MS-DOS filename that must contain at least one wildcard. The wildcards are a question mark (?), meaning match any character, and an asterisk (*), meaning match any number of characters.
If the lpszPath parameter includes a drive or directory name, or both, the current drive and directory are changed to the specified drive and directory before the list box is filled. The static control identified by the idStaticPath parameter is also updated with the new drive or directory name, or both.
After the list box of the combo box is filled, lpszPath is updated by removing the drive or directory portion, or both, of the path and filename.
DlgDirListComboBox sends CB_RESETCONTENT and CB_DIR messages to the combo box.