menu.LoadMenu(IDR_CONTEXTMENU);
2015-04-24 10:46:14 访问(2232) 赞(0) 踩(0)
1: void CDay11View::OnContextMenu(CWnd* pWnd, CPoint point)
2: {
3: // TODO: Add your message handler code here
4:
5: ///////////////////////
6: // MY CODE STARTS HERE
7: ///////////////////////
8:
9: CMenu menu;
10:
11: // Load the context menu
12: menu.LoadMenu(IDR_CONTEXTMENU);
13: // Get the first sub menu (the real menu)
14: CMenu *pContextMenu = menu.GetSubMenu(0);
15:
16: // Display the context menu for the user
17: pContextMenu->TrackPopupMenu(TPM_LEFTALIGN |
18: TPM_LEFTBUTTON | TPM_RIGHTBUTTON,
19: point.x, point.y, AfxGetMainWnd());
20:
21: ///////////////////////
22: // MY CODE ENDS HERE
23: ///////////////////////
24: }
标签:
menu.LoadMenu(IDR_CONTEXTMENU); 


上一条:
下一条:
相关评论
发表评论