PDA

Click to See Complete Forum and Search --> : GetSubMenu API function


liore
Jan 16th, 2001, 03:30 AM
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

Lechugas
Jan 23rd, 2001, 09:47 PM
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