-
Trackbar question
I have a horizontal trackbar and a static control. What I need is to while I move the slide the current value reflects on the static control...
While I already set the rang value:
Code:
SendDlgItemMessage(hWndDlg,IDC_SLIDER1,TBM_SETRANGE,TRUE,MAKELONG(1,90));
SendDlgItemMessage(hWndDlg,IDC_SLIDER1,TBM_SETBUDDY,FALSE,(LPARAM)GetDlgItem(hWndDlg,IDC_CURPOS));
Now left is to update the static control text with the current trackbar pos.
I aready tried with:
NM_RELEASEDCAPTURE but the notify event is only when I release the mouse button.
Do I need to subclass trackbar and capture some WM_HSCROLL or WM_MOUSEMOVE? Do I have to use TBM_SETBUDDY with some extra code?
Please help :(
-
I haven't used trackbars in a while (I just us a scroobar instead) but I believe that capturing the TB_THUMBTRACK message will let you update the static control, more or less on the fly.
-
Thanks CommonTater, you were close, trackbar uses also WM_HSCROLL and WM_VSCROLL :)