Announcement

Collapse
No announcement yet.

GetMenuItemInfo() - obtain caption without parenthandle

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • GetMenuItemInfo() - obtain caption without parenthandle

    I am trying to get some info like caption from a popuphandle.
    This function actually requires the parent menu handle and index or id.

    I am trying to do this without this parent handle.

    Idea?
    hellobasic

  • #2
    Huh?

    You say have a handle to the menu and you want info about an item on that menu. Is that correct?

    If you want info about an item on that menu, you must know which item, which means you must know either which index or which command ID....meaning GetMenuItemInfo() should be perfect.

    Or, If you don't know which item you want, you can enumerate all indices of the menu from zero to GetMenuItemCount(hMenu) - 1 and use GetMenuItemInfo() against each.

    If you want to get info about a menu, you have to have a handle, period. Otherwise how can Windows know in which menu currently active on the system you are interested?

    I must be missing something.

    MCM
    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      I said popuphandle.
      Iow: hSubMenu = GetSubMenu( hMenu, 0 )

      Now forget i knew hMenu and only have: hSubMenu

      I have been busy with menu's today and it seems i always need to know the parent handle and index (thus hMenu in this example)

      The menuitem info is obtained via the parentitem + index or id
      This is the main difference to other collections where the item itself has an id/handle.
      The menu functions are not prepared to do so, that is what i wanted confirmation about.
      No big deal anymore anyway.
      hellobasic

      Comment


      • #4
        > said popuphandle.
        >Iow: hSubMenu = GetSubMenu( hMenu, 0 )

        Ok, so you follow that with
        Code:
         
          X = GetMenuItemInfo  (hSubMenu....)
        >Now forget i knew hMenu and only have: hSubMenu

        That's a variable-management issue, not a menu issue. It happens to everyone once you accumulate enough candles on the birthday cake.

        MCM
        Michael Mattias
        Tal Systems Inc. (retired)
        Racine WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #5
          So enlightning.. again..
          hellobasic

          Comment

          Working...
          X