Notifiation Messages for CSpinButtonCtrl in MFC
-
Hi I created a control in my MFC application as follows:
CSpinButtonCtrl m_spin;
m_spin.Create(UDS_HORZ, CRect(0, 0, 50, 50), this, 1011);
m_spin.ShowWindow(1);which created a spin control with two button with left arrow and right arrow. Now i want to perform some job based on the user clicks on these two buttons. I tried by adding notification message in Message map as follows:
ON_NOTIFY(NM_CLICK, IDC_SPIN1, OnDropDown)
I tried with some other options in the ON_NOTIFY message but my function OnDropDown dint get hit in any case. Later i tried adding the ON_WM_HSCROLL() into my message map and finally it worked. It came inside my function OnDropDown(). But the problem is i want to know which button (left/right) user clicked. Based on the button (left/right) i want to perform some operation. But in
OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
funtion, the nSBCode is 4 and 8 everytime when i click left or right arrow. How to differentiate the left click and right click? May i know what is the exact message that should pass in Message map ?