How to get Popup menu item selected?

How do know what menu item was selected when you have a popup menu? I made a msg map with the menu ID but it does not seem to catch it.

Thanks,
 jer


HMENU hMenu;
 
      CMenu mMenu;      // Graph popup menu

    // Get the menu for the popup from the resource file
    mMenu.LoadMenu( IDR_GRAPHPOPUP );
      hMenu = mMenu.GetSafeHmenu();

    if (!hMenu)
        return;
 
    // Convert the mouse point to screen coordinates since that is what
    // TrackPopup expects.
    ::ClientToScreen( GetSafeHwnd(), (LPPOINT)&point );
 
    // Draw and track the "floating" popup  
    TrackPopupMenuEx( hMenu, TPM_VERTICAL | TPM_HORIZONTAL, point.x,
            point.y, GetSafeHwnd(), NULL );
 
    // Destroy the menu since were are done with it.
    DestroyMenu (hMenu);
pipeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
chensuConnect With a Mentor Commented:
BEGIN_MESSAGE_MAP(CMyWnd, CWnd)
    ON_COMMAND(ID_MENU, OnMenu)
END_MESSAGE_MAP()

void CMyWnd::OnMenu()
{
    //...
}
0
 
pipeAuthor Commented:
ah, that was subtle. I had:

ON_MESSAGE

instead of:

ON_COMMAND
0
All Courses

From novice to tech pro — start learning today.