ListCtrl the right-click menu problem

Category: VC/MFC -> UI Author: zhangwenfei2127 Date: 2007-11-01 15:08:34
2007-11-01 15:08:34
I want to add a right-click menu in ListCtrl ( style LVS_ICON) , the code is as follows :
CMenu   PopMenu;  
CPoint   pt;  
pt =   point  ;  

ClientToScreen   (& pt);  

GetCursorPos (& pt);
PopMenu.GetSubMenu (0) - > TrackPopupMenu (TPM_RIGHTBUTTON, pt.x, pt.y, this);
my idea is only in the ICON above right click menu only appears in the list box of the other right-click an empty area of ​​the menu there should not be there , but now has a menu appear anywhere ListCtrl inside , what should I modify ah, thank you