Defines the name screen readers announce for the combo box control.
C
int WINAPI SftBox_GetAccessibleName(HWND hwndCtl, LPTSTR lpszName, int cchMax); void WINAPI SftBox_SetAccessibleName(HWND hwndCtl, LPCTSTR lpszName);
C++
int CSftBox::GetAccessibleName(LPTSTR lpszName, int cchMax) const; void CSftBox::GetAccessibleName(CString& string) const; void CSftBox::SetAccessibleName(LPCTSTR lpszName);
hwndCtl
The window handle of the combo box control.
lpszName
GetAccessibleName: A pointer to a buffer where the name will be returned, or NULL to retrieve the length of the name. SetAccessibleName: A pointer to a string containing the new name. NULL is the same as an empty name.
cchMax
The size of the buffer pointed to by lpszName in characters, including the terminating '\0'.
string
A reference to a CString object where the name will be returned.
GetAccessibleName returns the number of characters returned in the buffer, not including the terminating '\0'. If lpszName is NULL or cchMax is 0, it returns the length of the name, so an application can allocate a buffer of the required size (the length plus one). A name longer than the buffer is truncated.
The GetAccessibleName and SetAccessibleName functions define the name screen readers such as Narrator, NVDA and JAWS announce for the combo box control.
The default is an empty name, for which screen readers announce the text of the static control (label) which precedes the combo box in the dialog, else "Control #" followed by the combo box's control ID. A combo box on a form without such a label, or whose label alone does not say what it is for, should be given a name. The edit control portion and the dropdown portion use the same name.
GetAccessibleName returns only the name defined using SetAccessibleName, or an empty string if none was defined, not the label text screen readers use when no name is defined.
When the name changes while a screen reader is attached, the combo box control raises a UI Automation property-changed event, so the screen reader uses the new name. See Accessibility (Screen Readers).
The Unicode DLLs export SftBox_GetAccessibleName_W and SftBox_SetAccessibleName_W, all DLLs export SftBox_GetAccessibleName_A and SftBox_SetAccessibleName_A, which convert the name using the system code page. SftBox.h maps the names without suffix to the _W functions if UNICODE or _UNICODE is defined, otherwise to the _A functions. GetAccessibleName and SetAccessibleName are available in SftBox/DLL 6.03 and later.
See Also C/C++ API | Categories | Accessibility (Screen Readers)