www.pudn.com > listen.zip > NewList.cpp, change:2005-03-14,size:986b


// NewList.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "listen.h" 
#include "NewList.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CNewList 
 
CNewList::CNewList() 
{ 
} 
 
CNewList::~CNewList() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CNewList, CListBox) 
	//{{AFX_MSG_MAP(CNewList) 
	ON_WM_CONTEXTMENU() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CNewList message handlers 
 
void CNewList::OnContextMenu(CWnd* pWnd, CPoint point)  
{ 
	// TODO: Add your message handler code here 
	CMenu menu; 
	menu.LoadMenu (IDR_MENU1); 
	CMenu* pContextMenu = menu.GetSubMenu (0); 
	if (GetCurSel()!=-1) 
		pContextMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd ()/*pWnd*/); 
	CWnd::OnContextMenu (pWnd, point); 
}