HeaderPane
Main
Hide
Share Link
Print

AccessibleName

Defines the name screen readers announce for a control.

C

int SftDate_GetAccessibleName(HWND hwndCtl, LPTSTR lpszName, int cchMax);
int WINAPI SftDate_GetAccessibleName_A(HWND hwndCtl, LPSTR lpszName, int cchMax);
int WINAPI SftDate_GetAccessibleName_W(HWND hwndCtl, LPWSTR lpszName, int cchMax);
void SftDate_SetAccessibleName(HWND hwndCtl, LPCTSTR lpszName);
void WINAPI SftDate_SetAccessibleName_A(HWND hwndCtl, LPCSTR lpszName);
void WINAPI SftDate_SetAccessibleName_W(HWND hwndCtl, LPCWSTR lpszName);

C++

int CSftDate::GetAccessibleName(LPTSTR lpszName, int cchMax) const;
CString CSftDate::GetAccessibleName() const;
void CSftDate::SetAccessibleName(LPCTSTR lpszName);
int CSftCalendar::GetAccessibleName(LPTSTR lpszName, int cchMax) const;
CString CSftCalendar::GetAccessibleName() const;
void CSftCalendar::SetAccessibleName(LPCTSTR lpszName);

Parameters

hwndCtl

The window handle of the date field control (SftDate) or the month calendar control (SftCalendar).

lpszName

Get: a pointer to the buffer that receives the name, or NULL to retrieve the length of the name.
Set: a pointer to the new name. NULL is the same as an empty name.

cchMax

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

Returns

The Get function returns the number of characters copied to the buffer, not including the terminating null character. If the buffer is NULL or cchMax is 0, it returns the length of the name instead, so an application can allocate a buffer of the required size (the length plus one). A name longer than the buffer is truncated.

Comments

The GetAccessibleName and SetAccessibleName functions define and retrieve the name screen readers such as Narrator and NVDA announce for a control. The default is an empty name. GetAccessibleName returns the name defined using SetAccessibleName, not the name derived from a label.

Without an accessible name, a control is named by the text of the static control (label) that immediately precedes it in the dialog; an ampersand used to define an accelerator key is removed. If there is no such static control, the control is named "Control #n", n being its control ID. An accessible name is used for windows without a preceding label, for example controls created at run time or placed in a window other than a dialog. The text box of a field with free-form editing takes the same name. See Accessibility (Screen Readers).

SftDate_GetAccessibleName and SftDate_SetAccessibleName are available in SftDate/DLL 2.01 and later.

SftDate.h maps the name without suffix to the _A (ANSI) or _W (Unicode) function, depending on whether UNICODE or _UNICODE is defined. The ANSI functions convert the text using the system code page.

See Also C/C++ API | Categories | Notifications


Last Updated 11/29/2026 - (email)
© 2026 Softel vdm, Inc.