0

I've created an application (C++, pure Win32, no ATL/MFC) which has a window with two buttons.

These are owner-drawn buttons, children of the window itself, and I create them using CreateWindowEx with a BS_OWNERDRAW style.

I'm doing accessibility testing at the moment and the text on my buttons is not being picked up by the screen reader. Are there special steps that need to be taken for button text to be picked out by a screen reader?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
BeneGal
  • 180
  • 1
  • 11
  • your button not displaying text?? is your problem??is it?? – Santosh Dhanawade Jul 01 '13 at 15:08
  • No, the button is displaying text, the screen reader is not identifying the text on the button and reading it out – BeneGal Jul 01 '13 at 15:10
  • Have you tried using SetWindow Text to provide the text to the button implementation? (That's probably where the screen reader looks for it, whether the button paints itself or not.) – ScottMcP-MVP Jul 01 '13 at 16:35
  • Microsoft has an entire Accessibility API for screen readers to use, specifically so they don't have to resort to such manual operations. Standard UI controls implement Accessibility by default, but I'm not sure how owner-drawn controls handle that. – Remy Lebeau Jul 01 '13 at 17:59

1 Answers1

1

As Scott mentioned, try setting the button's standard window text, even if you are drawing it manually. Otherwise, you will have to make your control implement the IAccessible interface, and respond to the WM_GETOBJECT window message, so it can provide such details, like custom text, to screen readers and automation tools.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770