Detecting right click over dialog button. 
Author Message
 Detecting right click over dialog button.

I have a dialog in my application that has a group of pushbuttons.
I want to detect a right click over the button to call a user
defined function.  I tried a OnRButtonDown() handler, but this
isn't called if the click happens over the button, only if it
happens off of a control, just on the dialog background.  What
message should I be looking for or how else should I approach
this problem?

--
---------------------------------------------------------
D. W. Hancock     Software Development
Pave Tech Inc.    
    *** remove 'F' from e-mail address to reply ***
---------------------------------------------------------



Sun, 02 Apr 2000 03:00:00 GMT  
 Detecting right click over dialog button.

Subclass CButton class as (say) CMyButton. Then add the message map for
WM_RBUTTONUP (you will have to do this manually) and handle the
message in your derived class CMyButton. Add a member variable for the
button you want to hadle right mouse button click and make sure that it
is
of type CMyButton and not CButton (if you add through classwizard it
will
make it to be of type CButton and not CMyButton !)
    OnRButtonUp() is better to use than OnRButtonDown().

Good Luck,

Abhijit V. Thatte
Tata Consultancy Services

Quote:

> I have a dialog in my application that has a group of pushbuttons.
> I want to detect a right click over the button to call a user
> defined function.  I tried a OnRButtonDown() handler, but this
> isn't called if the click happens over the button, only if it
> happens off of a control, just on the dialog background.  What
> message should I be looking for or how else should I approach
> this problem?

> --
> ---------------------------------------------------------
> D. W. Hancock     Software Development
> Pave Tech Inc.
>     *** remove 'F' from e-mail address to reply ***
> ---------------------------------------------------------



Mon, 03 Apr 2000 03:00:00 GMT  
 Detecting right click over dialog button.

Turn the mouse upside down :-)

sorry, This is a wasted post... just ignore me


Quote:
> I have a dialog in my application that has a group of pushbuttons.
> I want to detect a right click over the button to call a user
> defined function.  I tried a OnRButtonDown() handler, but this
> isn't called if the click happens over the button, only if it
> happens off of a control, just on the dialog background.  What
> message should I be looking for or how else should I approach
> this problem?

> --
> ---------------------------------------------------------
> D. W. Hancock     Software Development
> Pave Tech Inc.    
>     *** remove 'F' from e-mail address to reply ***
> ---------------------------------------------------------



Mon, 03 Apr 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

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

2. Detect left vs. right click event

3. Detect right click on CHeaderCtrl

4. problems detecting a right-click even on a rich edit control

5. (Q) Detecting right click in a CListBox

6. How to detect Right Click

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

8. Right mouse button click in CTreeView?

9. how to add right click support to a button

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

11. Right Button Click Msgs

12. Right button mouse click in CListBox

 

 
Powered by phpBB® Forum Software