CountMItems
CountMItems Find how many items are in a menu
#include <Menus.h> Menu Manager
short CountMItems(theMenu );
MenuHandle theMenu ; handle of menu of interest
returns number of items in theMenu
CountMItems returns the number of items in a specified menu. You may
use it as a way to get information about resource menus.
theMenu is a handle leading to a variable-length MenuInfo structure. It
identifies the menu about which you wish information.
Returns: a 16-bit short integer; the number of items in menu theMenu .

Notes: For menus created in your application, you should probably keep track of
how many items are in each menu.
For menus containing items inserted via AddResMenu and
InsertResMenu, this provides a way to find the number of items inserted
into the menu. You can use the return value as an index limit in subsequent
operations that examine the menu items.
See GetItem for an example of usage.