It is said that popup menu is one of the great creatures by Microsoft. And it is easy to add the popup menu in your MFC application. In fact, there are only 2 steps you need to do:
1. Create the menu resource for the popup menu, like this:
MENUITEM "Poisson Image Editing", ID_DSTVIEW_POISSON
MENUITEM "Drag and Drop Pasting", ID_DSTVIEW_DDPASTING
2. Overwrite the message handler for WM_CONTEXMENU, then it is done.
void CDstView::OnContextMenu(CWnd* /*pWnd*/, CPoint point)