The DlgDirListComboBox function fills the specified combo box with a directory listing. It fills the list with the names of all files, drives, and subdirectories that match the specified attributes and path string.
int DlgDirListComboBox(
HWND hDlg, // handle to dialog box with combo box
LPTSTR lpPathSpec, // pointer to path or filename string
int nIDComboBox, // identifier of combo box
int nIDStaticPath, // identifier of static control
UINT uFiletype // file attributes to display
);
[drive:][\]][directory\[...]][filename]
If the specified string includes a drive or directory path, the DlgDirListComboBox function changes the current drive and directory before filling the list. After the list is filled, the drive and directory path are removed from the string specified by the lpPathSpec parameter.
Value | Meaning |
---|---|
DDL_ARCHIVE | Includes archived files. |
DDL_DIRECTORY | Includes subdirectories. Subdirectory names are enclosed in square brackets ([ ]). |
DDL_DRIVES | Includes drives. 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. |
DDL_SYSTEM | Includes system files. |
DDL_POSTMSGS | Posts messages to the application's message queue. By default, the DlgDirList function sends messages directly to the dialog box procedure. |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. For example, if the string specified by lpPathSpec is not a valid path, the function fails. To get extended error information, call GetLastError.
If the lpszPathSpec parameter points to a zero-length string or to a string specifying a drive, directory, or both — but no filename — the filename *.* (wildcards) is assumed.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Combo Boxes Overview, Combo Box Functions, DlgDirList, DlgDirSelectComboBoxEx, GetFullPathName, SHGetFileInfo