BOOL DlgDirSelectEx(hwndDlg, lpszPath, cbPath, idListBox) | |||||
HWND hwndDlg; | /* handle of dialog box with list box | */ | |||
LPSTR lpszPath; | /* address of buffer for path string | */ | |||
int cbPath; | /* number of bytes in path string | */ | |||
int idListBox; | /* identifier of list box | */ |
The DlgDirSelectEx function retrieves the current selection from a list box. The specified list box should have been filled by the DlgDirList function, and the selection should be a drive letter, a file, or a directory name.
hwndDlg
Identifies the dialog box that contains the list box.
lpszPath
Points to a buffer that receives the selected path or filename.
cbPath
Specifies the length, in bytes, of the path or filename pointed to by the lpszPath parameter. This value should not be larger than 128.
idListBox
Specifies the integer identifier of a list box in the dialog box.
The return value is nonzero if the current list box selection is a directory name. Otherwise, it is zero.
If the current selection is a directory name or drive letter, DlgDirSelectEx removes the enclosing square brackets (and hyphens, for drive letters) so that the name or letter is ready to be inserted into a new path or filename. If there is no selection, the contents of buffer pointed to by the lpszPath parameter do not change.
The DlgDirSelectEx function does not allow more than one filename to be returned from a list box.
The list box must not be a multiple-selection list box. If it is, this function will not return a zero value and lpszPath will remain unchanged.
DlgDirSelectEx sends LB_GETCURSEL and LB_GETTEXT messages to the list box.
DlgDirList, DlgDirListComboBox, DlgDirSelect, DlgDirSelectComboBox