DlgDirSelectComboBoxExA function (winuser.h)
Retrieves the current selection from a combo box filled by using the DlgDirListComboBox function. The selection is interpreted as a drive letter, a file, or a directory name.
BOOL DlgDirSelectComboBoxExA( HWND hwndDlg, LPSTR lpString, int cchOut, int idComboBox );
A handle to the dialog box that contains the combo box.
A pointer to the buffer that receives the selected path.
The length, in characters, of the buffer pointed to by the lpString parameter.
The integer identifier of the combo box control in the dialog box.
If the current selection is a directory name, the return value is nonzero.
If the current selection is not a directory name, the return value is zero. To get extended error information, call GetLastError.
If the current selection specifies a directory name or drive letter, the DlgDirSelectComboBoxEx function removes the enclosing square brackets (and hyphens for drive letters) so the name or letter is ready to be inserted into a new path or file name. If there is no selection, the contents of the buffer pointed to by lpString do not change.
The DlgDirSelectComboBoxEx function does not allow more than one file name to be returned from a combo box.
If the string is as long or longer than the buffer, the buffer contains the truncated string with a terminating null character.
Security Warning: Improper use of this function can cause problems for your application. For instance, the nCount parameter should be set properly for both ANSI and Unicode versions. Failure to do so could lead to a buffer overflow. You should review Security Considerations: Microsoft Windows Controls before continuing.
Windows 95 or later: DlgDirSelectComboBoxExW is supported by the Microsoft Layer for Unicode (MSLU). To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows Me/98/95 Systems.
The winuser.h header defines DlgDirSelectComboBoxEx as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.
|Minimum supported client||Windows Vista [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||winuser.h (include Windows.h)|