Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CDialogBar and message notification trouble.

Posted on 1998-10-05
4
Medium Priority
?
439 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 300 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:Murali Devarakonda
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

916 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