Menu Modification Question
-
-
Ok, I know I am supposed to use ON_UPDATE_COMMAND_UI handlers for each menu item, but is there a way to do it for allof them from one function? I have a ton of these to go through if that is the case! (I just want to enable-disable them) Thanks
Yeah, just hook all the IDs up to the same function (i.e., when ClassWizard supplies you with a function name, just change it to be like OnUpdateAllMenuItems, and do this for every menu item you want to enable/disable at the same time). Chris Richardson C/C++ Include Finder[^]
-
Yeah, just hook all the IDs up to the same function (i.e., when ClassWizard supplies you with a function name, just change it to be like OnUpdateAllMenuItems, and do this for every menu item you want to enable/disable at the same time). Chris Richardson C/C++ Include Finder[^]
Thank you. I got it all working! Now I have a new problem.. When some of the top-level menues are disabled, then re-enabled some time later, they are not correnctly redrawn. They have the white from being diabled, and they aren't updated until the mouse is moved over them. How can I get the whole top-level menu redrawn? (File, Edit, etc.) Thanks again!
-
Thank you. I got it all working! Now I have a new problem.. When some of the top-level menues are disabled, then re-enabled some time later, they are not correnctly redrawn. They have the white from being diabled, and they aren't updated until the mouse is moved over them. How can I get the whole top-level menu redrawn? (File, Edit, etc.) Thanks again!
Call the DrawMenuBar member of your CMainFrame class. If you are doing the enable/disable in a class other than CMainFrame, you can do this:
AfxGetMainWnd()->DrawMenuBar();
Chris Richardson C/C++ Include Finder[^]