Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I catch Right mouse clicks?

I want to update a static text box with the description of a GUI button's functionality when the user right clicks it. Can I use a generic message handler in NiButton? I see message handlers for click, value changed, double-clicked etc. but none for right click. Maybe this is just a general windows question but I'd like to use the feature with my NiButtons if it's available. Thanks,

Grant
Grant M. Johnson
Project Engineer
LECO Corporation
0 Kudos
Message 1 of 2
(3,201 Views)
You can use the MouseDown event and check the Button parameter. For example:

void CTestDlg::OnMouseDownCwboolean1(short Button, short Shift, long x, long y)
{
if (Button == 2)
{
// Right button was clicked ...
}
}
Message 2 of 2
(3,201 Views)