Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

messages

Status
Not open for further replies.

bubak

Programmer
Jun 25, 2001
208
SK
Hi
I have class CBut with CButton as base class for it. In my class c1, i create 20 objects from this class. In c1 I catch click on it with ON_COMMAND_RANGE(id,id2,func(UINT id)); and I send it from CBut with CButton::OnLButtonDown.
I don't know, if it's the right way, but it works. Now I wan to catch also the right button click. How do I do that?
thx
bubak
 
Ususally what you are doing is done with ON_CONTROL_RANGE
like

ON_CONTROL_RANGE(BN_CLICKED, nStartID,nEndID,YourFunction)

Try with:
ON_CONTROL_RANGE(WM_RBUTTONDOWN, nStartID,nEndID,YourFunction);

Also consider the ON_MESSAGE macro. Then try to read the IDs inside the function, eventually from wparam, lparam)

{I haven't done this before but it worth a try}

HTH,

s-)

Blessed is he who in the name of justice and goodwill, sheperds the weak through the valley of darkness...
 
I though, it can be done with sth like sendmessage(WM_NOTIFY,..sth) and cauth with OnNotify, but I don;t know how. ;-(
bubak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top