append一个menu
为什么是灰的呢?enable以后还是不行
如果想动态创建一个popup菜单和子菜单(资源里面没有)
怎么向popup菜单里面添加子菜单呢?
为什么是灰的呢?enable以后还是不行
如果想动态创建一个popup菜单和子菜单(资源里面没有)
怎么向popup菜单里面添加子菜单呢?
解决方案 »
- 注册表reg运行时,会提示一句话是否注册//如何去掉
- CreateIpForwardEntry函数在WinXp及Win7上运行的问题?
- 问个opengl TextureManager 类的问题
- 在ListView中显示1个对话框,为什么在ListView视中获取不到该对话框中ListCtrl控件的指针,它的句柄为什么总是0?
- 各位大侠,请问如何在VC++中调用ORACLE的函数,急!!!
- 请教一个有关于双缓冲的问题!急死我了!谢谢!
- 高手请进,在线等待。
- 有哪位高手能做出一个VC6.0的简版(不要MFC) ???
- 滑块控件的问题
- 谁能给我详细解释一下“堆”的概念
- 怎么样对CAxDialogImpl<CHasmo>中的数据进行数据交换?就像CDialog的DoDataExchange?
- Win2K下如何终于一个进程?
BOOL InsertMenu( UINT nPosition, UINT nFlags, UINT nIDNewItem = 0, LPCTSTR lpszNewItem = NULL );
北京博彦科技发展有限责任公司译
可以解决你的很多问题
oid CMenusDlg::OnContextMenu(CWnd* pWnd, CPoint point)
{
// TODO: Add your message handler code here
//my code starts here
//declare local variable
CMenu *m_lMenu;//a pointer to the menu
CPoint m_pPoint;//a copy of the mouse position
//copy the mouse Position to a local variable
m_pPoint=point;
// covert the position to a screen position
ClientToScreen(&m_pPoint);
//get a pointer to window menu
m_lMenu=GetMenu();
//get a pointer to the first submenu
m_lMenu=m_lMenu->GetSubMenu(0);
//show the popup menu
m_lMenu->TrackPopupMenu(TPM_CENTERALIGN+TPM_LEFTBUTTON,
m_pPoint.x,m_pPoint.y,this,NULL); //MY CODE ENDS HERE
}