关于VB控件中使用MENU的问题。
请教各位大侠了。。。。
调用winapi制作菜单控件,如何修改菜单的背景色,或者修改背景图片啊?
Public Declare Function createMenu Lib "user32" Alias "CreateMenu" () As Long
Public Declare Function SetMenu Lib "user32" (ByVal hwnd As Long, ByVal hmenu As Long) As Long
Public Declare Function InsertMenuItem Lib "user32" Alias "InsertMenuItemA" (ByVal hmenu As Long, ByVal un As Long, ByVal BOOL As Boolean, ByRef lpcMenuItemInfo As MENUITEMINFO) As Long
以下是部分代码:
Dim mii As MENUITEMINFO
With mii
'.hbmpChecked = "c:\\1.jpg"
.cbSize = Len(mii)
.fMask = MIIM_STATE Or MIIM_ID Or MIIM_TYPE
If bSubmenu Then
.fMask = .fMask Or MIIM_SUBMENU
.hsubmenu = hsubmenu
End If
.fType = MFT_STRING
.fState = MFS_ENABLED
.wID = id
.dwTypeData = label
.cch = Len(.dwTypeData)
End With
createMenuItem = mii