Enables or disables a menu item.
Takes userDefinedID (Int) and enable (Int).
Returns 1 on success, 0 if item or parent not found.
BGI GUI
Parameters & Returns
Parameters
userDefinedIDInt
enableInt
Returns
Int
Quick Summary
Enables or disables a menu item.
Takes userDefinedID (Int) and enable (Int).
Returns 1 on success, 0 if item or parent not found.
Technical Exegesis...
Sets the enabled state of a menu item identified by userDefinedID. Searches menuMap for the item to find its parentID, then finds the parent submenu. If enable is non-zero (true), calls EnableMenuItem with MF_BYCOMMAND | MF_ENABLED. If enable is zero (false), calls EnableMenuItem with MF_DISABLED to gray out the item. Updates the internal CMenu.isEnabled field. Returns 1 on success, 0 if item or parent not found.
Disabled items appear grayed out and cannot be clicked.
Sets the enabled state of a menu item identified by userDefinedID. Searches menuMap for the item to find its parentID, then finds the parent submenu. If enable is non-zero (true), calls EnableMenuItem with MF_BYCOMMAND | MF_ENABLED. If enable is zero (false), calls EnableMenuItem with MF_DISABLED to gray out the item. Updates the internal CMenu.isEnabled field. Returns 1 on success, 0 if item or parent not found.
Disabled items appear grayed out and cannot be clicked. Common for context-sensitive commands like "Paste" when clipboard is empty, or "Undo" when nothing to undo. Changes take effect immediately without needing bgiUpdateWindowMenu. Use bgiIsMenuItemEnabled to query the current state. Enabled state is independent of checked state.