PopMenu
void CTransferAgentAccountDlg::OnRclickListAgentAc(NMHDR* pNMHDR, LRESULT* pResult)
{
POSITION pos;
CMenu popmenu, *psubMenu = NULL;
CPoint oPoint;
pos = m_ListAgent.GetFirstSelectedItemPosition();
if(!pos)
{
return;
}
GetCursorPos( &oPoint);
popmenu.LoadMenu(IDR_MENU_AGENT);
psubMenu = popmenu.GetSubMenu(0);
psubMenu->TrackPopupMenu(TPM_LEFTALIGN, oPoint.x, oPoint.y, this);
*pResult = 0;
}
delete menu
psubMenu->DeleteMenu(ID_MEMU_FIFO_IB_ADD, MF_GRAYED);
psubMenu->DeleteMenu(ID_MEMU_FIFO_IB_DELETE, MF_GRAYED);
psubMenu->DeleteMenu(ID_MEMU_FIFO_IB_EDIT, MF_GRAYED);
enable menu
psubMenu->EnableMenuItem(ID_MEMU_FIFO_IB_VIEW, MF_GRAYED);