Slider Ctrl
-
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
-
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
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."
-
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."
Whether is his meaning ON_WM_MOUSEMOVE/WM_MOUSELEAVE messages on slider movement .
-
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."
-
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
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."
-
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
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: { }. . . . .