Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Messages missing for slider controls (and also for spinbuttons etc.)?

Messages missing for slider controls (and also for spinbuttons etc.)?

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DaFrawg
    wrote on last edited by
    #1

    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?)

    R I C 3 Replies Last reply
    0
    • D DaFrawg

      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?)

      R Offline
      R Offline
      Roger Allen
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • D DaFrawg

        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?)

        I Offline
        I Offline
        Iain Clarke Warrior Programmer
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0
        • D DaFrawg

          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?)

          C Offline
          C Offline
          Chris Hills
          wrote on last edited by
          #4

          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.

          D 1 Reply Last reply
          0
          • C Chris Hills

            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.

            D Offline
            D Offline
            DaFrawg
            wrote on last edited by
            #5

            How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?

            C A 2 Replies Last reply
            0
            • D DaFrawg

              How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?

              C Offline
              C Offline
              Chris Hills
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0
              • D DaFrawg

                How can I receive those messages? ClassWizard doesn't show them. Should I add them to the message map manually?

                A Offline
                A Offline
                Atlantys
                wrote on last edited by
                #7

                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]

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups