Link to home
Start Free TrialLog in
Avatar of mikeljj
mikeljj

asked on

GRAYED Menu Items

I am aware of the EnabledMenuItem fuction which takes three parameters.  How to a get the handler of the default menu??
The other two parameters are self explanatory.
Avatar of zingo
zingo

This is the "MFC Programming Question" area, so I guess the best answer I could give you is to use CMenu, which has its own version of EnableMenuItem. Then you don't need the handle.

CMenu menu;
if (menu.LoadMenu(IDR_MY_MENU))
{
  menu.EnableMenuItem(nIDEnableItem, nEnable);
}

GetMenu() will return a pointer to the windows menu. (Call this in CMainFrame if you want to get the app manu).
Avatar of mikeljj

ASKER

piano boxer, can I call this from CView??
ASKER CERTIFIED SOLUTION
Avatar of piano_boxer
piano_boxer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial