HeaderPane
Main
Hide
Share Link
Print

GetAccessibleName

Return the name screen readers announce for the button, as defined using SetAccessibleName.

C

int SftButton_GetAccessibleName(HWND hwndCtl, LPTSTR lpszName, int cchMax);
int WINAPI SftButton_GetAccessibleName_A(HWND hwndCtl, LPSTR lpszName, int cchMax);
int WINAPI SftButton_GetAccessibleName_W(HWND hwndCtl, LPWSTR lpszName, int cchMax);

C++

int CSftButton::GetAccessibleName(LPTSTR lpszName, int cchMax) const;
void CSftButton::GetAccessibleName(CString& string) const;

Parameters

hwndCtl

The window handle of the button control.

lpszName

The buffer receiving the name, or NULL to retrieve the length of the name.

cchMax

The buffer size, in characters, including the terminating null character.

string

A reference to a CString object where the name will be returned.

Return Value

The number of characters copied, not including the terminating null character. If lpszName is NULL or cchMax is 0, 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.

Comments

GetAccessibleName returns the name defined using SetAccessibleName, or an empty string if none was defined. It does not return the button text screen readers use when no name is defined.

SftButton.h maps the name without suffix to the _A (ANSI) or _W (Unicode) function, depending on whether UNICODE or _UNICODE is defined. The ANSI function converts the name using the system code page. GetAccessibleName is available in SftButton/DLL 3.02 and later.

See Also SetAccessibleName | Accessibility (Screen Readers)


Last Updated 12/03/2026 - (email)
© 2026 Softel vdm, Inc.