The MASM Forum Archive 2004 to 2012

Project Support Forums => IDE Development and Support => Easy Code => Topic started by: xdnlq21 on December 29, 2006, 10:22:08 AM

Title: Menu Items
Post by: xdnlq21 on December 29, 2006, 10:22:08 AM
Hi,

I want to enable/disable a menu item and don't understand how to get the handle to the menu or to menu items.

Any help in this matter is appreciated.

Thanks! - Mark Wright
Title: Re: Menu Items
Post by: xdnlq21 on December 29, 2006, 12:04:25 PM
Hi,

It looks like I solved my own problem. Menu items can be controlled through windows.
To disable my menu item I wrot:

   Invoke GetMenu, hWnd  ;handle to window with the menu
   Invoke EnableMenuItem, Eax, IDM_WINDOW1_EASYCODE, MF_GRAYED  ;the menu item created with menu editor

to enable,

   Invoke GetMenu, hWnd
   Invoke EnableMenuItem, Eax, IDM_WINDOW1_EASYCODE, MF_ENABLED

can be used.

Hope this helps someone else - Mark Wright

Title: Re: Menu Items
Post by: Ramon Sala on January 01, 2007, 07:21:16 PM
Hi and happy new year to everybody!

Effectively, you solved your problem very well. The EnableMenuItem function is the solution.

Regards ,

Ramon