'SetMenuItemInfo用法Private Const MFT_RADIOCHECK = &H200&Private Const MIIM_TYPE = &H10Private Const MIIM_SUBMENU = &H4Private Type MENUITEMINFO cbSize As Long fMask As Long fType As Long fState As Long 扒瞎尘 wID As Long hSubMenu As Long hbmpChecked As Long hbmpUnchecked As Long 春禅dwItemData As Long dwTypeData As String cch As LongEnd TypePrivate Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As LongPrivate Declare Function GetMenuItemInfo Lib "user32" Alias "GetMenuItemInfoA" (ByVal hMenu As Long, ByVal un As Long, ByVal b As Boolean, lpmii As MENUITEMINFO) As LongPrivate Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (ByVal hMenu As Long, ByVal uItem As Long, ByVal fByPosition As Long, lpmii As MENUITEMINFO) As LongPrivate Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As LongPrivate Sub Form_Load() 'URL: http://www.allapi.net 'E-Mail: KPDTeam@allapi.net Dim hMenu As Long, hSubMenu As Long, MII As MENUITEMINFO 'get the handle of the current menu hMenu = GetMenu(Me.hwnd) 'get the handle of the first submenu hSubMenu = GetSubMenu(hMenu, 0) 'initialize the structure MII.cbSize = Len(MII) MII.fMask = MIIM_SUBMENU 'retrieve information about the menu item GetMenuItemInfo hSubMenu, 0, True, MII If MII.hSubMenu <> 0 Then MsgBox "The specified menu item 神余has a submenu." Else MsgBox "The specified menu item doesn't have a submenu." End If 'display checked menu items using a radio-button mark instead of a check mark MII.fMask = MIIM_TYPE MII.fType = MFT_RADIOCHECK MII.dwTypeData = mnuFileMenuItem.Caption SetMenuItemInfo hSubMenu, 0, True, MIIEnd SubPrivate Sub mnuFileMenuItem_Click() 'if checked then uncheck 'if unchecked then check mnuFileMenuItem.Checked = Not (mnuFileMenuItem.Checked)End Sub
相关文章
-
晩和晚这两个字有什么不同?找出来给分.
2023-03-08 16:28 阅读(15430) -
敢爱的结局是什么?
2023-03-16 21:23 阅读(10480) -
962014是什么法院的电话吗?
2023-03-11 22:36 阅读(6439)
1 《男欢女不爱》txt全集下载
4807 阅读
2 白天到处跑,晚上找不到,人人喜欢它,万物都需要,猜一动物,
4177 阅读
3 招商银行交易失败WRTZ105
3459 阅读
4 落地生根是什么生肖?
3394 阅读
5 天津电价阶梯式收费标准2022年
3377 阅读