Hi
Env: Win10, VC++, MFC
I create a TrackBar (CSliderCtrl) and want snap it to each 100 step. but the result is not work and the slider is stuck or move smoothly. In the MSDN wrote the
TRBN_THUMBPOSCHANGING notification result is ignored but i think is is important to snap!
my code is:
void CZoomCtrl::OnSliderChanging(NMHDR* pNMHDR, LRESULT* pResult)
{
NMTRBTHUMBPOSCHANGING* pNMTR = (NMTRBTHUMBPOSCHANGING*)pNMHDR;
*pResult = 1;
int nPos = pNMTR->dwPos;
if ((nPos % 100) == 0)
{
nPos = (int)(nPos / 100) * 100;
m_wndZoomSlider.SetPos(nPos);
*pResult = 0;
}
}
Thanks