Click to See Complete Forum and Search --> : popup menu


July 28th, 1999, 07:31 PM
how can i create a popup-contetxmenu (e.g when i click somewhere in the document window)? i created a menubar in the resourceeditor but will it work with an ordinary meunbar? how do I create and display such a menu?

Burlacu Ovidiu
July 29th, 1999, 01:40 AM
1)In resource editor create a menu resource
2)Go to menu item properties and at caption type a space(no name but u must type something so type a space)
3)Then add to this no name menu all items you need, then try this function:

void CInsCol::OnRButtonDown(UINT nFlags, CPoint point)
{
CMenu m_Menu;
CPoint point;
GetCursorPos(&point);
m_Menu.LoadMenu( IDR_MENU1 );
CMenu* pPopup = m_Menu.GetSubMenu( 0 );
pPopup->TrackPopupMenu( TPM_RIGHTBUTTON, point.x, point.y, this );

CDialog::OnRButtonDown(nFlags, point);
}