Skip to content

Latest commit

 

History

History
128 lines (83 loc) · 5.51 KB

nf-winuser-dlgdirselectcomboboxexa.md

File metadata and controls

128 lines (83 loc) · 5.51 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:winuser.DlgDirSelectComboBoxExA
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. (ANSI)
DlgDirSelectComboBoxExA
winuser/DlgDirSelectComboBoxExA
controls\DlgDirSelectComboBoxEx.htm
Controls
VS|Controls|~\controls\comboboxes\comboboxreference\comboboxfunctions\dlgdirselectcomboboxex.htm
12/05/2018
DlgDirSelectComboBoxEx, DlgDirSelectComboBoxEx function [Windows Controls], DlgDirSelectComboBoxExA, DlgDirSelectComboBoxExW, _win32_DlgDirSelectComboBoxEx, _win32_DlgDirSelectComboBoxEx_cpp, controls.DlgDirSelectComboBoxEx, controls._win32_DlgDirSelectComboBoxEx, winuser/DlgDirSelectComboBoxEx, winuser/DlgDirSelectComboBoxExA, winuser/DlgDirSelectComboBoxExW
winuser.h
Windows.h
Windows
Windows Vista [desktop apps only]
Windows Server 2003 [desktop apps only]
DlgDirSelectComboBoxExW (Unicode) and DlgDirSelectComboBoxExA (ANSI)
User32.lib
User32.dll
Windows
19H1
DlgDirSelectComboBoxExA
winuser/DlgDirSelectComboBoxExA
c++
APIRef
kbSyntax
DllExport
User32.dll
DlgDirSelectComboBoxEx
DlgDirSelectComboBoxExA
DlgDirSelectComboBoxExW

DlgDirSelectComboBoxExA function

-description

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.

-parameters

-param hwndDlg [in]

Type: HWND

A handle to the dialog box that contains the combo box.

-param lpString [out]

Type: LPTSTR

A pointer to the buffer that receives the selected path.

-param cchOut [in]

Type: int

The length, in characters, of the buffer pointed to by the lpString parameter.

-param idComboBox [in]

Type: int

The integer identifier of the combo box control in the dialog box.

-returns

Type: BOOL

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.

-remarks

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.

DlgDirSelectComboBoxEx sends CB_GETCURSEL and CB_GETLBTEXT messages to the combo box.

You can use this function with all three types of combo boxes (CBS_SIMPLE, CBS_DROPDOWN, and CBS_DROPDOWNLIST).

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.

Note

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.

-see-also

CB_GETCURSEL

CB_GETLBTEXT

DlgDirListComboBox

Reference