Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.


Retrieves the current selection from the list box of a combo box.

BOOL DlgDirSelectComboBox( 
   LPTSTR lpString, 
   int nIDComboBox  


Points to a buffer that is to receive the selected path.


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

Nonzero if successful; otherwise 0.

It assumes that the list box has been filled by the DlgDirListComboBox member function and that the selection is a drive letter, a file, or a directory name.

The DlgDirSelectComboBox member function copies the selection to the specified buffer. If there is no selection, the contents of the buffer are not changed.

DlgDirSelectComboBox sends CB_GETCURSEL and CB_GETLBTEXT messages to the combo box.

It does not allow more than one filename to be returned from a combo box.

Header: afxwin.h

Community Additions

© 2015 Microsoft