Solved

CSliderCtrl notifications

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 150
How do you programatically show and hide the Windows 10 On-Screen-Keyboard? 3 1,024
How to determine file rename from EventLog ? 2 62
Problem to App 4 145
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.
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

738 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