D: Means Disabled
HBMMENU_SYSTEM = 1
|
| HBMMENU_MBAR_RESTORE = 2 |
| HBMMENU_MBAR_MINIMIZE = 3 |
| HBMMENU_MBAR_CLOSE = 5 |
| HBMMENU_MBAR_CLOSE_D = 6 |
| HBMMENU_MBAR_MINIMIZE_D = 7 |
| HBMMENU_POPUP_CLOSE = 8 |
| HBMMENU_POPUP_RESTORE = 9 |
| HBMMENU_POPUP_MAXIMIZE = 10 |
| HBMMENU_POPUP_MINIMIZE = 11
|
MF_GRAYED=&H1 : MF_DISABLED=&H2 : MF_BYPOSITION=&H40
Dim Hicon As IntPtr = img.GetHbitmap
'remove first item
RemoveMenu(iMenu, 0, MF_BYPOSITION)
DrawMenuBar(iMenu)
'add new item
InsertMenu(iMenu, 0, MF_BYPOSITION, 0, "Restore")
DrawMenuBar(iMenu)
SetMenuItemBitmaps(iMenu, 0, MF_GRAYED Or MF_BITMAP, Hicon, Hicon)
'disable
EnableMenuItem(iMenu, 0, MF_BYPOSITION + MF_DISABLED + MF_GRAYED)
DrawMenuBar(iMenu)9