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. Slider Ctrl

Slider Ctrl

Scheduled Pinned Locked Moved C / C++ / MFC
designhardwarehelp
6 Posts 4 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.
  • S Offline
    S Offline
    ScotDolan
    wrote on last edited by
    #1

    I have a dialog User Interface that has two Sliders and several other buttons. I am looking for a way to find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement. Any help would be great.

    Scott Dolan Jernie Corporation Engineering & Manufacturing Software, Hardware, & Enclosures

    M D 2 Replies Last reply
    0
    • S ScotDolan

      I have a dialog User Interface that has two Sliders and several other buttons. I am looking for a way to find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement. Any help would be great.

      Scott Dolan Jernie Corporation Engineering & Manufacturing Software, Hardware, & Enclosures

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      ScotDolan wrote:

      find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement.

      The parent will receive WM_HSCROLL/WM_HSCROLL notification messages on slider movement. To look for it being selected, maybe respond to WM_SETFOCUS in the control(?) Check out the "Trackbar Notification Messages" section here: Trackbar Controls[^] Mark

      "Go that way, really fast. If something gets in your way, turn."

      Z S 2 Replies Last reply
      0
      • M Mark Salsbery

        ScotDolan wrote:

        find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement.

        The parent will receive WM_HSCROLL/WM_HSCROLL notification messages on slider movement. To look for it being selected, maybe respond to WM_SETFOCUS in the control(?) Check out the "Trackbar Notification Messages" section here: Trackbar Controls[^] Mark

        "Go that way, really fast. If something gets in your way, turn."

        Z Offline
        Z Offline
        zhang800605
        wrote on last edited by
        #3

        Whether is his meaning ON_WM_MOUSEMOVE/WM_MOUSELEAVE messages on slider movement .

        1 Reply Last reply
        0
        • M Mark Salsbery

          ScotDolan wrote:

          find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement.

          The parent will receive WM_HSCROLL/WM_HSCROLL notification messages on slider movement. To look for it being selected, maybe respond to WM_SETFOCUS in the control(?) Check out the "Trackbar Notification Messages" section here: Trackbar Controls[^] Mark

          "Go that way, really fast. If something gets in your way, turn."

          S Offline
          S Offline
          ScotDolan
          wrote on last edited by
          #4

          I am not sure how to obtain, set or get the WM_SETFOCUS messages from Dialog item.

          Scott Dolan Jernie Corporation Engineering & Manufacturing Software, Hardware, & Enclosures

          M 1 Reply Last reply
          0
          • S ScotDolan

            I am not sure how to obtain, set or get the WM_SETFOCUS messages from Dialog item.

            Scott Dolan Jernie Corporation Engineering & Manufacturing Software, Hardware, & Enclosures

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #5

            You stated you wanted to know if the control was "selected" so hopefully that means you need to know when it gets focus (like when you tab to a control in a dialog). If so, you could... In MFC, derive a class from CSliderCtrl and add a handler for WM_SETFOCUS. For non-MFC, subclass the trackbar control and look for the WM_SETFOCUS message there.

            "Go that way, really fast. If something gets in your way, turn."

            1 Reply Last reply
            0
            • S ScotDolan

              I have a dialog User Interface that has two Sliders and several other buttons. I am looking for a way to find out when a particular slider is selected and/or active. Active meaning the mouse movement results in slider movement. Any help would be great.

              Scott Dolan Jernie Corporation Engineering & Manufacturing Software, Hardware, & Enclosures

              D Offline
              D Offline
              drexel1718
              wrote on last edited by
              #6

              Why don't you cast the pScrollBar parameter pass with the OnHScroll to CSliderctrl.. void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) { // TODO: Add your message handler code here and/or call default int nControl=pScrollBar->GetDlgCtrlID(); CSliderCtrl* pControl= static_cast(GetDlgItem(nControl)); switch (nControl) { case IDC_SLD_CTRL: { }. . . . .

              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