Right-click menu problem

Category: C/C++ -> C++ Author: hahaxiaole Date: 2007-03-01 19:42:56
 
hahaxiaole
2007-03-01 19:42:56

BEGIN_MESSAGE_MAP(CChatDialog, CDialog)
//{{AFX_MSG_MAP(CChatDialog)
ON_WM_CONTEXTMENU()
ON_COMMAND(IDM_PRIVATECHAT, OnPrivatechat)
//}}AFX_MSG_MAP
ON_WM_CLOSE()
END_MESSAGE_MAP()


void CChatDialog::OnContextMenu(CWnd* pWnd, CPoint point) 
{
m_PopupMenu.GetSubMenu(0)->TrackPopupMenu(TPM_RIGHTALIGN |TPM_LEFTBUTTON, point.x, point.y, pWnd);
// TODO: Add your message handler code here

}
void CChatDialog::OnPrivatechat() 
{
// TODO: Add your command handler code here

}


context menus pop up, but is available, that can not be entered after clicking OnPrivatechat function, there is no master know why ~ I the first time to engage in right-click menu
tavfuf398z
2007-03-01 19:56:51
IDM_PRIVATECHAT this is not repeated to be covered
qq419401765
2007-03-01 20:04:59
OnPrivatechat and your popup What is the relationship?
zyf88
2007-03-01 20:22:57
OnPrivatechat items to be processed popup pop it?
windash2009
2007-03-01 20:34:43
IDM_PRIVATECHAT is the menu item ID it?
lori20009
2007-03-01 20:51:23
m_PopupMenu.GetSubMenu (0) -> TrackPopupMenu (
TPM_LEFTALIGN | TPM_RIGHTBUTTON, point. x, point.y, AfxGetApp () -> GetMainWnd ());

phoenix_y
2007-03-01 21:00:19
pWnd

Identifies the window that owns ; the pop-up menu. This window receives all WM_COMMAND messages from the menu. In Windows versions 3.1 and later, the window does not receive WM_COMMAND messages until TrackPopupMenu returns. In Windows 3.0, the window receives WM_COMMAND messages before TrackPopupMenu returns.

pop-up menu window instructions.