1

I need to enable accessibility for the CMFCMenubar to use it in the coded ui test (not supported by default) as mentioned in this post on MSDN Visual Studio blog that MFC feature pack controls (like CMFCMenuBar) are not fully supported.

I used a tool that test the accessibility support in my software it is in this path C:\Program Files\Windows Kits\8.1\bin\x86 "inspect.exe", when I used UI Automation it works, but when I use the MSAA (the same technology used in the coded ui test) it fails.

I tried the following hopping to make it work:

  1. I created a new project and checked the support Accessibility checkbox in the wizard.
  2. I called the method GetGlobalData()->EnableAccessibilitySupport(TRUE); in the first entry of the application.
  3. I called EnableActiveAccessibility(); in the frames, also for the menubar(it is call it by default if the GetGlobalData()->IsAccessibilitySupport() is true)

but it failed , How to enable it I need some help

Ryan B
  • 3,364
  • 21
  • 35
ahmedsafan86
  • 1,776
  • 1
  • 26
  • 49
  • As mentioned in the blog post, some stuff is just not accessible. Why some stuff is not accessible is beyond me, the usual fixes are 1- choose another pack of controls, or 2- rewrite the control yourself and allow it to be accessible. Most people choose #1. – Ryan B Apr 15 '14 at 18:49
  • It is easier for me to rewrite the controls and make them accessible if it is possible, The CMFCMenuBar is a window and it is accessible [only for its children , the top level buttons], when you click on a button the dropped down menu is another control that is CMFCPopupMenu this is the one that I don't know how to customize it? – ahmedsafan86 Apr 16 '14 at 07:46

1 Answers1

0

If you look at the derivation of the CMFCmenubar and its associated "buttons", you'll see that the buttons, at the base level, are derived from CObject. That's why they're not supported by coded ui. Coded ui cannot see them. We are experiencing the same issue with our coded ui tests. At the present, there's no easy work around if you use the classes from the feature pack.

rrirower
  • 4,338
  • 4
  • 27
  • 45
  • There must be a solution, they are virtual buttons but are already drawn in a real control[window] the menubar it self can provide data about the its buttons[main menu items File, Edit, ....], but not for their children [they are cmfcpopupmenu the recorded test click the File and the submenu is shown but it can't recognise the sub menu] – ahmedsafan86 Apr 16 '14 at 07:42