I have a MFC dialog in which buttons get dynamically created on the page. I use a ON_CONTROL_RANGE(BN_CLICKED, 10000,10500, OnBnClicked) and this captures any left click on the button and it works great. I now want to handle right click on these buttons. Is there a way in which i can capture the right click on an ID range given above? or do i need to capture the NM_RCLICK and see if the mouse point is in any of my button's rect (using ptinrect())?
I tried to use the ON_NOTIFY_RANGE(NM_RCLICK, 10000, 10500, OnRClicked),but this isn't generating the message. I am using that message wrong?