Archived

This topic is now archived and is closed to further replies.

AlexM

slider ctrl

Recommended Posts

AlexM    122
i''m trying to use the slider ctrl in win gui (VC++ 6). In msdn it says the control sends notify messages to the parent window and you can override OnHScroll() or handle them directly using ON_NOTIFY. I tried both, but it just doesn''t seem to get any messages... code: void CIOD1::OnThumbPos(NMHDR*nh,long*ll) { int pos = ((CSliderCtrl*)GetDlgItem(SLIDER))->GetPos(); ioh->frame = ((float)pos/100.0f)*(float)ioh->count - 1; char temp[100]; sprintf(temp,"Frame: %d, Total: %d",ioh->frame+1,ioh->count); SetDlgItemText(L2,temp); } BEGIN_MESSAGE_MAP(CIOD1,CDialog) ON_NOTIFY(TB_THUMBPOSITION,SLIDER,OnThumbPos) What''s going on?

Share this post


Link to post
Share on other sites
OldGuy    122
My manual says that the TB_THUMBPOSITION message is sent when the left mouse button is release after the thumb is dragged. Did you drag the thumb? If not, that might be why you didn''t get the callback.

The TB_THUMBTRACK message is generated when "The thumb is dragged to a new position with the mouse".

The other messages a CSlider can get are as follow:

TB_TOP
TB_BOTTOM
TB_LINEDOWN
TB_LINEUP
TB_PAGEDOWN
TB_PAGEUP
TB_ENDTRACK

Do you get any of these messages?

Share this post


Link to post
Share on other sites