Handle the WM_MENUSELECT message. The wParam is the menu index, which is also the index of the stringtable entry that describes the menu. This prompting is ordinarily handled by the mainframe, but in a dialog-based app you have to add your own handler You can look at the code in the mfc\src\winfrm.cpp, although it is very general; you probably only need a subset of it.
probably only need a subset of it.
--------------------------------------------------------------------------------
void CMainFrame::GetMessageString(UINT nID, CString& rMessage) const
{
if(nID == ID_FILE_NEW) //这里可以动态改变
{
//rMessage中的内容就是菜单ID_FILE_NEW的提示内容,也可以在这里自己改
return;
}
CFrameWnd::GetMessageString(nID,rMessage); //调用默认的处理过程
}
--------------------------------------------------------------------------------
LoadString(NULL,nItemID, szTip,MAX_PATH);//nItemID为鼠标正在移动的菜单上
GetDlgItem(IDC_STATIC_MSG)->SetWindowText(szTip);