Solved

CSliderCtrl notifications

Posted on 1997-05-17
2
810 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 538
Expand macro to ask for filename column 8 37
sum67 challenge 35 93
Message not shown 5 33
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now