BOOL DlgDirSelectComboBox(hDlg,lpString,nIDComboBox)
This function retrieves the current selection from the list box of a combo box created with the CBS_SIMPLE style. It cannot be used with combo boxes created with either the CBS_DROPDOWN or CBS_DROPDOWNLIST 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 DlgDirSelectComboBox function copies the selection to the buffer given by the lpString parameter. If the current selection is a directory name or drive letter, DlgDirSelectComboBox 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.
DlgDirSelectComboBox sends CB_GETCURSEL and CB_GETLBTEXT messages to the combo box.
Parameter | Type/Description | |
hDlg | HWND Identifies the dialog box that contains the combo box. | |
lpString | LPSTR Points to a buffer that is to receive the selected pathname. | |
nIDComboBox | int 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.
The DlgDirSelectComboBox function does not allow more than one filename to be returned from a combo box.