0
votes

I have a modal dialog that I would like to implement a right mouse click event on. I have added ON_WM_RBUTTONDOWN() to the class's message map.

BEGIN_MESSAGE_MAP(MyDialog, CDialog)
    //{{AFX_MSG_MAP(MyDialog)
    ON_WM_RBUTTONDOWN()
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

and have overridden the class's afx_msg void OnRButtonDown(UINT nFlags, CPoint point);

However, my OnRButtonDown function does not execute when I click the mouse button on the Dialog window. My dialog is called using DoModal(), could it be that modal dialogs don't allow for these mouse events? Is there something else that I'm missing?

1

1 Answers

0
votes

No, this should work also in modal dialogs. Two possible scenarios:

  1. you have an invisible control which captures the click

  2. you have overridden the window procedure and do something unwanted with the message.