Solved

CSliderCtrl notifications

Posted on 1997-05-17
2
816 Views
Last Modified: 2013-11-19
I have a dialogbar  with a slider control in it. Using ClassWizard, I added
handlers for the notification messages I was interested in.
I want those notifications to be handled by the CMainframe class owning the CDialogbar.

None of the notifications messages are dispatched for CsliderCtrl controls.  Also, I noticed that Windows is sending for example a WM_SETFOCUS message and not a NM_SETFOCUS message.  And even if it's a WM_SETFOCUS message, I can't trap it.

Do I need to add something to my code in order to ensure that the
notification messages are actually sent? Or do I need to add something to
the message map to handle the WM_ messages being sent to the control?  I would like to be able to trap WM_HSCROLL too wenever the user slides the track bar.

Best Regards,

Charles Bissonnette

0
Comment
Question by:biss
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1301616
A slider control notifies its parent window of user actions by sending the parent WM_HSCROLL messages. In your case, the parent window of the slider control is the CDialogbar. You should override CDialogbar::OnHScroll member function to transfer the message to the CMainframe.
void CDialogbar::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
    ::AfxGetMainWnd()->PostMessage(WM_HSCROLL, MAKEWPARAM(nSBCode, nPos), LPARAM(pScrollBar->GetSafeHwnd()));
}

0
 

Author Comment

by:biss
ID: 1301617
Thanks ,
 
I though every messages dispatched by a cdialogbar class were  routed directly to his host parent class.

Right now I catch the WM_NOTIFY messages and It seems to work fine, but it's very a pain in the neck since every messages are not only sent when you slide the track bar, but also every time  I lost the focus on the control.  This adds overhead for nothings.

And thanks for you tips,

Charles


0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question