tags:

views:

40

answers:

1

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?

A: 

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.

dwo
I did some looking, it appears that the entire dialog is made using a .bmp as the background. That must be what is taking the click events? Thanks for the reply.
MarkB42