DlgDirSelect

2.x

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

The DlgDirSelect function retrieves the current selection from a list box. It assumes that the list box has been filled by the DlgDirList function and that the selection is a drive letter, a file, or a directory name.

Parameters

hwndDlg

Identifies the dialog box that contains the list box.

lpszPath

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

idListBox

Specifies the integer identifier of a list box in the dialog box.

Return Value

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

Comments

If the current selection is a directory name or drive letter, DlgDirSelect 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 the buffer pointed to by the lpszPath parameter do not change.

The DlgDirSelect 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.

DlgDirSelect sends LB_GETCURSEL and LB_GETTEXT messages to the list box.

See Also

DlgDirList, DlgDirListComboBox, DlgDirSelectComboBox, DlgDirSelectEx