對話方塊,選單如何響應:ON_UPDATE_COMMAND_UI訊息
阿新 • • 發佈:2018-12-27
需要增添虛擬函式:
BOOL CXXXDlg::ContinueModal()
{
CMenu* p_main_mu = this->GetMenu();
CCmdUI cmd_ui;
for(u_int n = 0; n < p_main_mu->GetMenuItemCount(); ++n)
{
CMenu* p_sub_mu = p_main_mu-> GetSubMenu(n);
cmd_ui.m_nIndexMax = p_sub_mu-> GetMenuItemCount();
for(u_int i = 0; i < cmd_ui.m_nIndexMax; ++i)
{
cmd_ui.m_nIndex = i;
cmd_ui.m_nID = p_sub_mu-> GetMenuItemID(i);
cmd_ui.m_pMenu = p_sub_mu;
cmd_ui.DoUpdate(this, FALSE);
}
}
return CDialog::ContinueModal();
}