Results 1 to 2 of 2

Thread: GetSubMenu API function

  1. #1

    Thread Starter
    Member
    Join Date
    Nov 2000
    Posts
    37

    Red face

    Hi,

    I created a menu on design time and when I use the API function GetSubMenu like this:
    mSub = GetSubMenu(GetMenu(Me.hwnd), 0)
    I get 0 in mSub. What could be the reason? Does it have anything to do with the fact that I use this function in a MDI child form?

    Thanks, Lior

  2. #2
    New Member
    Join Date
    Sep 2000
    Posts
    7

    Wink your solution

    Private Sub GraMen()

    On Error Resume Next

    Dim lngMenu As Long
    Dim lngMenuItemId As Long
    Dim lngRet As Long
    Dim lngSubMenu As Long

    lngMenu = GetMenu(Me.hWnd)
    lngSubMenu = GetSubMenu(lngMenu, 0)
    lngMenuItemId = GetMenuItemID(lngSubMenu, 3)
    lngRet = SetMenuItemBitmaps(lngMenu, lngMenuItemId, MF_BITMAP, Picture2.Picture, Picture2.Picture)

    End Sub
    Things must be easy, but not easier than they are.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width