GetSubMenu

The GetSubMenu function retrieves the handle to the drop-down menu or submenu activated by the specified menu item.

HMENU GetSubMenu(
  HMENU hMenu,  // handle to menu
  int nPos      // menu item position
);
 

Parameters

hMenu
Handle to the menu.
nPos
Specifies the zero-based relative position in the given menu of an item that activates a drop-down menu or submenu.

Return Values

If the function succeeds, the return value is the handle to the drop-down menu or submenu activated by the menu item. If the menu item does not activate a drop-down menu or submenu, the return value is NULL.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Requires version 1.0 or later.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Menus Overview, Menu Functions, CreatePopupMenu, GetMenu