Link to home
Start Free TrialLog in
Avatar of marcus78
marcus78

asked on

change a menu item's text

I'd like be able to change the text of a menu item at runtime.  In particular, I'm trying to change the text of the item which is normally edit->undo.  I'm going for the same idea like in MS Word where it says "Undo Typing" or if you format some text it'll say "Undo Bold", etc...

So how can I change this dynamically? The id will always be ID_EDIT_UNDO.

Thanks,
Marcus
ASKER CERTIFIED SOLUTION
Avatar of DanRollins
DanRollins
Flag of United States of America image

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
Avatar of MichaelS
MichaelS

If you don't use MFC than use SetMenuItemInfo API function. First you call GetMenu(hWnd), than GetSubMenu() for retrieving your "Edit" menu and than SetMenuItemInfo to set the new text.
Avatar of marcus78

ASKER

Whoa! I was completely overthinking that one.  Thanks, Dan!

Marcus