DlgDirSelectComboBox

3.0

  BOOL DlgDirSelectComboBox(hwndDlg, lpszPath, idComboBox)    
  HWND hwndDlg; /* handle of dialog box with list box */
  LPSTR lpszPath; /* address of buffer for path or filename string */
  int idComboBox; /* identifier of combo box */

The DlgDirSelectComboBox function retrieves the current selection from the list box of a combo box. 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.

Parameters

hwndDlg

Identifies the dialog box that contains the combo box.

lpszPath

Points to a 128-byte buffer for the path or filename.

idComboBox

Specifies the integer identifier of the combo box in the dialog box.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

The DlgDirSelectComboBox function does not allow more than one selection to be returned from a combo box.

If the current selection is a directory name or drive letter, DlgDirSelectComboBox removes the enclosing 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.

DlgDirSelectComboBox sends CB_GETCURSEL and CB_GETLBTEXT messages to the combo box.

See Also

DlgDirList, DlgDirListComboBox, DlgDirSelect, DlgDirSelectComboBoxEx, DlgDirSelectEx