VB动态自定义菜单项(自绘菜单)

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

Public Sub SetMenuBar(ByVal clr As Long)
  Dim MyMenu As MENUINFO
  MyMenu.cbSize = Len(MyMenu)
  MyMenu.fMask = MIM_BACKGROUND Or MIM_APPLYTOSUBMENUS
  MyMenu.hbrBack = CreateSolidBrush(clr)
  SetMenuInfo GetMenu(Form1.hwnd), MyMenu
End Sub