Microsoft KB Archive/195253

{|
 * width="100%"|

INFO: Cannot Determine Whether Menu Has Submenu Using MSAA

 * }

Q195253

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), on platform(s):
 * Microsoft Windows 95
 * Microsoft Windows 98

-

SUMMARY
There is no foolproof way to determine if a menu has an associated submenu using Microsoft Active Accessibility (MSAA).

MORE INFORMATION
If a menu item has an IAccessible object of its own, you can use the get_accChildCount method of the IAccessible interface to return the number of children it has. If the number of children is one or more, it has a pop- up menu associated with it.

However, menu items are usually children of the menu and they do not have their own IAccessible objects. Moreover, most applications expose menu items as leaf children of the menu. This results in the menu items reporting zero children when you use the get_accChildCount method.

For example, Microsoft Word exposes each of its menu items with their own IAccessible objects. As a result, it is possible to find out if a menu in Word has a submenu.

On the other hand, under Windows 95 with Internet Explorer 4.0, the Start Menu fails to expose its menu items, which makes it impossible to determine if its menu items have an associated pop-up menu. This also occurs under Internet Explorer 4.0.