You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me, the labeling doesn't work with either NVDA or Narrator.
It seems you're using SetWindowText to set the labels:
m_wndVolSlider.SetWindowText(szCtrlName);
Accessibility doesn't look at window text for sliders. Instead, you should use MSAA direct dynamic annotation: https://msdn.microsoft.com/en-us/library/windows/desktop/dd318057(v=vs.85).aspx
Something like the following should do the trick:
IAccPropServices* accPropServices = NULL;
CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, (void**)&accPropServices);
...
accPropServices->SetHwndPropStr(sliderHwnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_NAME, szCtrlName);
The text was updated successfully, but these errors were encountered:
(Posting here rather than the blog to make tracking easier.)
Bjoern wrote:
Hi James, I get the following error when I try to build:
error LNK2001: unresolved external symbol CLSID_AccPropServices
What library do I need to link?
It's not a library you need to link. Rather, you need to #include <initguid.h> and #include <oleacc.h> (in that order).
For me, the labeling doesn't work with either NVDA or Narrator.
It seems you're using SetWindowText to set the labels:
m_wndVolSlider.SetWindowText(szCtrlName);
Accessibility doesn't look at window text for sliders. Instead, you should use MSAA direct dynamic annotation:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd318057(v=vs.85).aspx
Something like the following should do the trick:
IAccPropServices* accPropServices = NULL;
CoCreateInstance(CLSID_AccPropServices, NULL, CLSCTX_SERVER, IID_IAccPropServices, (void**)&accPropServices);
...
accPropServices->SetHwndPropStr(sliderHwnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_NAME, szCtrlName);
The text was updated successfully, but these errors were encountered: