MFC does not allow to trap all the events on the CButton control but some commonly used events like BN_CLICKED and BN_DOUBLECLICKED and so to trap a right mouse button events on a CButton MFC you need to derive a new class from the CButton.
MyButton.h
Right mouse button event handler
MyButton.h
Code:
class CMyButton : public CButton { // Construction public: CMyButton(); // Attributes public: // Operations public: // Overrides // ClassWizard generated virtual function overrides...