Solved

CSliderCtrl notifications

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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 35
sum67 challenge 35 98
How to convert MFC::CString to UTF8 wchar_t* 10 211
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 94
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

777 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