Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Detect right-click on a Win32 button?

Hi,

I have an application where I want something different to happen depending on whether a user either left or right clicks on a Win32 button. The button is created like:

CreateWindow("button", NULL, WS_CHILD | BS_ICON......etc

I can easily detect when the button is left clicked on by trapping the WM_COMMAND event and finding which component generated the event. But how do I detect when the button is right-clicked on instead?

Many thanks,

Chopper23.

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : Hi,
    :
    : I have an application where I want something different to happen
    : depending on whether a user either left or right clicks on a Win32
    : button. The button is created like:
    :
    : CreateWindow("button", NULL, WS_CHILD | BS_ICON......etc
    :
    : I can easily detect when the button is left clicked on by trapping
    : the WM_COMMAND event and finding which component generated the
    : event. But how do I detect when the button is right-clicked on
    : instead?
    :
    : Many thanks,
    :
    : Chopper23.
    :
    [color=Blue]
    Subclassing is the way:

    http://msdn2.microsoft.com/en-us/library/bb773183(VS.85).aspx
    [/color]
  • chopper23chopper23 Member Posts: 3
    : [color=Blue]
    : Subclassing is the way:
    :
    : http://msdn2.microsoft.com/en-us/library/bb773183(VS.85).aspx
    : [/color]

    Many thanks mate. I will take a look at that.


    Chopper
Sign In or Register to comment.