In the past few days, in order to write a small program, add a toolbar and menu (Menu) on the dialog, online friendly multi-program teach you how to add toolbars and menus on the dialog, but very little mention The toolbar and menu adds on_update_command_ui mapping, and later, I have been searching for a long time, I found some methods, it is more complicated. In fact, just add the following functions in the dialog class.
BOOL CMyDlg :: ContinueModal () {if (m_wndtoolbar.IsWindowVisible ()) {CFrameWnd * pParent = (CFrameWnd *) m_wndtoolbar.GetParent (); if (pParent) m_wndtoolbar.OnUpdateCmdUI (pParent, (WPARAM) TRUE);}
CMenu * PMainMenu = getMenu (); ccmdui cmdui; for (uint n = 0; n
In addition, reminding that some articles use the WM_KICKIDLE message. I found that the CPU usage was 100% after use. Needless to make
The function is another shortcoming:
If you switch the view with a keyboard, this function does not respond, that is, if you use the right-click menu, if you include a variable according to the VIEW, it is not possible.