Solved

CDialogBar and message notification trouble.

Posted on 1998-10-05
4
389 Views
Last Modified: 2013-11-20
Env: Windows NT 4.0/SP3, Visual C++ 5.0/SP3.

I'm trying to use a dockable CDialogBar in a SDI application, where the CDialogBar has a control (CStatic derived, Notify property enabled). I have added message handlers for WM_LBUTTONDOWN/WM_LBUTTONUP in the derived CStatic class, but no such messages arrives. How can they be enabled?
0
Comment
Question by:stefanr
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
plaroche earned 100 total points
ID: 1322919
The static control sends notifications to its parent when it has been created with the SS_NOTIFY style. Those notifications are:

STN_CLICKED  
STN_DBLCLK  
STN_DISABLE  
STN_ENABLE  
WM_CTLCOLORSTATIC

You can get that notification with OnCommand as stated in the doc for STN_CLICKED, example:

BOOL CYourWnd::OnCommand(WPARAM wParam, LPARAM lParam)
{
    WORD wNotifyCode = HIWORD(wParam); // notification code
    WORD wID = LOWORD(wParam);         // item, control, or accelerator identifier
    HWND hwndCtl = (HWND)lParam;      // handle of control       

    switch( wNotifyCode ) {
    case STN_CLICKED:
        break;
    }

      return CWnd::OnCommand(wParam, lParam);
}


0
 
LVL 1

Expert Comment

by:MuraliKrishna
ID: 1322920
You need to add the message handlers in one of the following classes:
Frame, View, Document or App.

Only these classes get messages from controls on a CDialogBar.

Regards,
Murali Krishna Devarakonda
0
 
LVL 3

Author Comment

by:stefanr
ID: 1322921
Plaroche, thank you for the answer. I tried it, and it worked as you said it would. Thanks to that I could experiment a little, and I saw that the variable created with ClassWizard was not subclassed properly. When I did that manually, it worked as I wanted in the first place. So even if I'm not using the solution you provided me, it helped to get me to get on the right track.
0
 
LVL 3

Author Comment

by:stefanr
ID: 1322922
Plaroche, thank you for the answer. I tried it, and it worked as you said it would. Thanks to that I could experiment a little, and I saw that the variable created with ClassWizard was not subclassed properly. When I did that manually, it worked as I wanted in the first place. So even if I'm not using the solution you provided me, it helped to get me to get on the right track.
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
Rewrite URL With Encoded Characters 6 74
iSeries FTP Exit Program 8 122
method notes when mouse over in eclipse 5 82
Way to decrease size of apk file 9 40
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…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

929 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

10 Experts available now in Live!

Get 1:1 Help Now