Right Button Click Msgs 
Author Message
 Right Button Click Msgs

I need to get the notification of a right mouse button click on a button
control on a Formview.  I put the following in my message handler:

ON_NOTIFY( NM_RCLICK, IDC_BUTTON1, OnRButtonClick)

The button is created in the resource editor with the NOTIFY attribute but
the call is never made when I right click on the button.

What am I doing wrong, or what is the best way to handle this.

Thanks,

Jim



Mon, 29 Sep 2003 11:49:50 GMT  
 Right Button Click Msgs

Quote:
>I need to get the notification of a right mouse button click on a button
>control on a Formview.  I put the following in my message handler:

>ON_NOTIFY( NM_RCLICK, IDC_BUTTON1, OnRButtonClick)

Jim,

As far as I know a normal button doesn't use WM_NOTIFY and it doesn't
give a specific notification to its parent for right click. The only
notification I'm aware of is the WM_CONTEXTMENU message, so if that's
not ideal, the only solution may be to sub-class the button and handle
the WM_RBUTTONDOWN message for the button itself.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Mon, 29 Sep 2003 15:01:32 GMT  
 Right Button Click Msgs
Seeing Dave's response reminded me that the classical common controls such
as buttons do not send WM_NOTIFY messages. They send notification messages
as command messages. See MFC "TN061: ON_NOTIFY and WM_NOTIFY Messages".


Quote:
> I need to get the notification of a right mouse button click on a button
> control on a Formview.  I put the following in my message handler:

> ON_NOTIFY( NM_RCLICK, IDC_BUTTON1, OnRButtonClick)

> The button is created in the resource editor with the NOTIFY attribute but
> the call is never made when I right click on the button.

> What am I doing wrong, or what is the best way to handle this.

> Thanks,

> Jim



Mon, 29 Sep 2003 15:12:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help: Detect when right button is clicked above a button

2. x and y coordinates when i click right mouse button

3. Right mouse button click in CTreeView?

4. how to add right click support to a button

5. how to capture right click messages on a button controll

6. Right button mouse click in CListBox

7. Getting item selected in CTreeCtrl when right button clicked

8. Overwriting Right Mouse Button click of edit boxes

9. Right clicking buttons?

10. Popup menu clicking the right mouse button

11. howto track a right mouse click from a dialogbar button

12. Right click on button

 

 
Powered by phpBB® Forum Software