News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Menu Items

Started by xdnlq21, December 29, 2006, 10:22:08 AM

Previous topic - Next topic

xdnlq21

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

xdnlq21

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


Ramon Sala

Hi and happy new year to everybody!

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

Regards ,

Ramon
Greetings from Catalonia