Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

narlymon

Popup Menu not popping up ;(

This topic is 6697 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, all. This is straight from the book. It compiles fine, but when I run it and click the RMB, no popup menu appears. What gives? CMenu * g_pmenuContext; CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { ... g_pmenuContext = new CMenu(); if (!g_pmenuContext) return -1; BOOL bSuccess = g_pmenuContext->LoadMenu(IDR_MENU1); if (!bSuccess) return -1; ... } void CMainFrame::OnRButtonDown(UINT nFlags, CPoint point) { ClientToScreen(&point); CMenu * psubmenu = g_pmenuContext->GetSubMenu(1); psubmenu->TrackPopupMenu(TPM_LEFTALIGN /TPM_RIGHTBUTTON, point.x, point.y, this); CFrameWnd::OnRButtonDown(nFlags, point); } Thanks

Share this post


Link to post
Share on other sites
Advertisement
Hi!

You need to handle the WM_CONTEXTMENU message.


void CMyView::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu menu;
menu.LoadMenu(IDR_MYFLOATINGMENU);
menu.GetSubMenu(0)->TrackPopupMenu(.......);
}


*Sparkle*


Edited by - Sparkle on 4/12/00 5:24:44 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!