Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IAccPropServices on slider controls in Classic client #187

Closed
bear101 opened this issue Apr 22, 2016 · 1 comment
Closed

Use IAccPropServices on slider controls in Classic client #187

bear101 opened this issue Apr 22, 2016 · 1 comment

Comments

@bear101
Copy link
Contributor

bear101 commented Apr 22, 2016

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);

@jcsteh
Copy link

jcsteh commented Apr 26, 2016

(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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants