Share via

ToolbarCtrl on Dialog (MFC)

drjackool 956 Reputation points
2021-02-14T20:42:07.25+00:00

Hi
I created a toolbar using CToolbarCtrl on a DialogBar, I added tooltips using handle message TTN_NEDTEXT... My question is how add text message support in StatusBar.

I handle WM_SETMESSAGESTRING in DialogBar derived class but this message is not sent to it!

My main frame is MDI
Thanks

Developer technologies | C++
Developer technologies | C++

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2021-02-16T07:30:39.053+00:00

    Hi,

    My question is how add text message support in StatusBar.

    I suggest you could try to add the text by SetPaneText(0, "Something").

    You could refer to the Doc: https://learn.microsoft.com/en-us/cpp/mfc/reference/cstatusbar-class?view=msvc-160#setpanetext

    I handle WM_SETMESSAGESTRING in DialogBar derived class but this message is not sent to it!

    Whether you have captured the following message?

    ON_MESSAGE(WM_SETMESSAGESTRING, OnSetMessageString)  
    
    
    LRESULT CMainFrame::OnSetMessageString(WPARAM wParam, LPARAM lParam)  
    {  
        if (wParam == AFX_IDS_IDLEMESSAGE)  
        {  
            m_wndStatusBar.SetPaneText(0,m_sStatusBarText);  
            return 0;  
        }  
      
      
        return CFrameWndEx::OnSetMessageString(wParam,lParam);  
    }  
    

    Best Regards,

    Jeanine


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.