sorry i didn't get back sooner, Jack
EnableMenuItem uses a handle for the menu - and a number for the menu item
so, let's say you have an Main menu, with File, Edit, View, Help submenus
typically, you will have the handle for the Main menu
either when you load it or attach it
if not, use GetMenu to get the Main menu attached to a window
now, you want a handle for the submenus, File, Edit, View, Help
these menus are attached to the Main menu, in the order created
but, you can get the handles by using numbers 0, 1, 2, 3
File = 0
Edit = 1
View = 2
Help = 3
if they were created in that order (also the order they appear)
use GetSubMenu for to get the handle(s)
INVOKE GetSubMenu,hmenuMain,1 ;get the handle for the Edit menu
mov hmenuEdit,eax
your submenus may have submenus below them, as well
in that case, use the handle for the submenu, and the item number to get the sub-sub-menu handle
now, you can use EnableMenuItem
if you use the MF_BYPOSITION flag, it again wants a zero-based number of the item
if you use the MF_BYCOMMAND flag, you use the ID number (1101, etc), typically in the form of an EQU like IDM_CUT
you can only use one of those flags - not both together
MF_BYCOMMAND is the default (=0)
INVOKE EnableMenuItem,hmenuEdit,IDM_CUT,MF_BYCOMMAND or MF_GRAYED or MF_DISABLED
INVOKE EnableMenuItem,hmenuEdit,0,MF_BYPOSITION or MF_GRAYED or MF_DISABLED
both calls do the same thing