Help with context menu programming.
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
hi everyone, i added a context menu to my sdi project, based on treeview, but the context menu doesn't work correctly. the problem with my context menu is that whenever i right single click on a treenode, the context menu doesn't popup, which the context menu supposes to popup. the context menu only pops up when i double right click on a node.. i'm running winxp and using visual studio.net.. any suggestion is welcome.. thx in advance. this is the code i added to my message map: ON_WM_CONTEXTMENU() this are the codes that i used for my context menu: void CLeftView::OnContextMenu(CWnd *pWnd, CPoint point) { CMenu menu; menu.LoadMenu(IDR_MENU1); menu.GetSubMenu(0) ->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this); }