none
Could Not Get The String Or Caption Of Menu And SubMenu RRS feed

  • Question

  • Hi 

    I Need String Of Each Item In Menu And SubMenu Item But Just Retrieve ItemId Not its Caption 

    hmenu=GetMenu(lhwnd)

    HsubMenu=GetSubMenu(hmenu,0)

    for i=0 To GetMenuitemCount(Hmenu) -1 

    dim Buff As String * 256

    dim BuffLen As Long

    Buff=String$(255,Chr(0))

    BuffLen=GetMenuStringW(Hsubmenu,i,Buff,Bufflen,MF_BYCOMMAND)

    Txt=Left$(Buff,BuffLen)

    Msgbox Txt & "..." & GetMenuItemId(hsubmenu,0)

    Next

    BuffLen Return 0 




    • Edited by Grailly Ali Saturday, August 10, 2019 2:13 PM
    Saturday, August 10, 2019 2:09 PM

All replies

  • Hello,

    Is this for VB.NET? I ask because it seems like VB6 which if so should be asked here, also I noticed you have been posting in C++ forums, yet another reason for asking.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Saturday, August 10, 2019 2:47 PM
    Moderator