Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EnableMenuItem

Status
Not open for further replies.

cpfc

Programmer
Aug 4, 2003
23
0
0
GB
Hi...
I call EnableMenuItem to disable or enable a popup menu item...

Here is my code:
Menu.EnableMenuItem(1,MF_BYPOSITION | MF_BYCOMMAND | MF_ENABLED);

Only after calling this function the menu don't redraw itself, so the item still looks disabled...
If you hover the mouse over the menu item only then does it redraw...

Hope you can help and thanks in advance...
 
If you are using a MFC application you need to set the menu item status when you recieve the message ON_COMMAND_UPDATE_UI

-pete
 
Thanks for reply...
I can't find ON_COMMAND_UPDATE_UI anywhere within MSDN Library Visual Studio 6.0.
I'm guessing that message gets called after a user clicks a submenu or something...
If thats the case I think you've misunderstood my problem...
I'm trying to enable a menu item thats always visible, for example on Internet Explorer 6.0 the items File, Edit, View, Favorites, Tools and Help are always visible...
I call EnableMenuItem for one of thease items it don't redraw until mouse hovers over them...
Thanks again...
 
>> I think you've misunderstood my problem...

I do think i follow your post. I did forget to mention that to simply enable a menu item all you need is a message handler for the command itself. although the ON_COMMAND_UPDATE_UI will also work but of course i typed it backwards so that did not help at all it is actually ON_UPDATE_COMMAND_UI sorry about that.



-pete
 
Thanks I got it working now...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top