BOOL DlgDirSelectComboBoxEx(hwndDlg, lpString, cchString, nIDComboBox) | |||||
HWND hwndDlg; | /* handle of dialog box with list box | */ | |||
LPTSTR lpString; | /* address of buffer for path string | */ | |||
int cchString; | /* number of characters in path string | */ | |||
int nIDComboBox; | /* identifier of combo box | */ |
This function retrieves the current selection from the list box of a combo box created with the CBS_SIMPLE style. It assumes that the list box has been filled by the DlgDirListComboBox function and that the selection is a drive letter, a file, or a directory name.
The DlgDirSelectComboBoxEx function copies the selection to the buffer given by the lpString parameter. If the current selection is a directory name or drive letter, DlgDirSelectComboBoxEx removes the enclosing square brackets (and hyphens, for drive letters) so that the name or letter is ready to be inserted into a new pathname. If there is no selection, lpString does not change.
DlgDirSelectComboBoxEx sends CB_GETCURSEL and CB_GETLBTEXT messages to the combo box.
hwndDlg
Identifies the dialog box that contains the combo box.
lpString
Points to a buffer that is to receive the selected pathname.
cchString
Specifies the length of the string (in characters) pointed to by lpString.
nIDComboBox
Specifies the integer ID of the combo-box control in the dialog box.
The return value specifies the status of the current combo-box selection. It is nonzero if the current selection is a directory name. Otherwise, it is zero.
In Win32, this function can be used with drop-down combo boxes (combo boxes created with either the CBS_DROPDOWN or CBS_DROPDOWNLIST style).
The DlgDirSelectComboBox function does not allow more than one filename to be returned from a combo box.
The DlgDirSelectComboBoxEx function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).
DlgDirSelectEx, DlgDirListComboBox