Messages missing for slider controls (and also for spinbuttons etc.)?
-
How do I determine if a slider is changed? There is no message for that. (So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
Spin button controls send you a WM_HSCROLL or WM_VSCROLL message. Not sure what a slider does Roger Allen Sonork 100.10016 Death come early, death come late, It takes us all, there is no reason. For every purpose under heaven, To each a turn, to each a season. A time to weep and a time to sigh, A time to laugh and a time to cry, A time to be born and a time to die. Dust to dust and ashes to ashes, And so I end my song.
-
How do I determine if a slider is changed? There is no message for that. (So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
As already said, spin controls send WM_H/VSCROLL messages. Sliders = Trackbar controls send TB_LINEUP etc. Look in the Platform SDK under User Interface Services > Windows Common Controls. OK?
-
How do I determine if a slider is changed? There is no message for that. (So, if I fiddle around with a CSliderCtrl, what message or whatever is sent/whatevert?)
A spinbutton control sends UDN_DELTAPOS to its parent window when it's spun. lParam is the address of "an NMUPDOWN structure that contains information about the position change" (to quote MSDN). Sliders send WM_HSCROLL and WM_VSCROLL messages.
-
A spinbutton control sends UDN_DELTAPOS to its parent window when it's spun. lParam is the address of "an NMUPDOWN structure that contains information about the position change" (to quote MSDN). Sliders send WM_HSCROLL and WM_VSCROLL messages.
-
How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?
You can get ClassWizard to add handlers for UDN_DELTAPOS messages :), but I can't remember how :(. I think you just select the spinner control and add a message handler for it. Have a look at my article at http://www.codeproject.com/dialog/CRHChildDialog.asp . Although it's not specifically about spinner controls, it does use them. So if you search the source files for DELTAPOS you'll see what happens.
-
How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?
DaFrawg wrote: ClassWizard doesn't show them Right-click on the Dialog class that contains the spin control. In the window that appears, select the IDC of the control you want to receive notifications about, in the "Class or object to handle" listbox. UDN_DELTAPOS should appear, along with NM_OUTOFMEMORY, in the "New Windows messages/events" listbox on the left hand side. There you go! Sliders receive both the WM_HSCROLL and WM_VSCROLL messages. You can either handle them in the control itself, or through the parent dialog. The kindest thing you can do for a stupid person, and for the gene pool, is to let him expire of his own dumb choices. [Roger Wright on stupid people] We're like private member functions [John Theal on R&D] We're figuring out the parent thing as we go though. Kinda like setting up Linux for the first time ya' know... [Nitron]