Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 64537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:48:19+00:00 2026-05-10T18:48:19+00:00

Right now, I have a tool tip that pops up when I hover over

  • 0

Right now, I have a tool tip that pops up when I hover over an edit box. The problem is that this tool tip contains multiple error messages and they are all in one long line. I need to have each error message be on its own line. The error messages are contained in a CString with a new line seperating them.

My existing code is below.

BOOL OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult) {     ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);     // need to handle both ANSI and UNICODE versions of the message     TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;     TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;     //    TCHAR szFullText[256];     CString strTipText=_T('');     UINT nID = pNMHDR->idFrom;     if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||         pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))     {         // idFrom is actually the HWND of the tool         nID = ::GetDlgCtrlID((HWND)nID);     }      //m_errProjAccel[ch] contains 1 or more error messages each seperated by a new line.     if((int)nID >= ID_PROJECTED_ACCEL1 && (int)nID < ID_PROJECTED_ACCEL1 + PROJECTED_ROWS -1 ) {         int ch = nID - ID_PROJECTED_ACCEL1;         strTipText = m_errProjAccel[ch];     }    #ifndef _UNICODE     if (pNMHDR->code == TTN_NEEDTEXTA)         lstrcpyn(pTTTA->szText, strTipText, sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0]));     else         _mbstowcsz(pTTTW->szText, strTipText, sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])); #else     if (pNMHDR->code == TTN_NEEDTEXTA)         _wcstombsz(pTTTA->szText, strTipText, sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0]));     else         lstrcpyn(pTTTW->szText, strTipText, sizeof(pTTTA->szText)/sizeof(pTTTA->szText[0])); #endif     *pResult = 0;      // bring the tooltip window above other popup windows     ::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0,         SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);      return TRUE;    // message was handled } 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:48:20+00:00Added an answer on May 10, 2026 at 6:48 pm

    Creating multiline tooltips is explained here in the MSDN library – read the ‘Implementing Multiline ToolTips’ section. You should send a TTM_SETMAXTIPWIDTH message to the ToolTip control in response to a TTN_GETDISPINFO notification to force it to use multiple lines. In your string you should separate lines with \r\n.

    Also, if your text is more than 80 characters, you should use the lpszText member of the NMTTDISPINFO structure instead of copying into the szText array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 104k
  • Answers 104k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer After a quick look through the NSURLRequest APIs I don't… May 11, 2026 at 8:38 pm
  • Editorial Team
    Editorial Team added an answer Changing the value of the textbox that is the TargetControlId… May 11, 2026 at 8:38 pm
  • Editorial Team
    Editorial Team added an answer Normal rectangle with a dotted rectangle in the top right… May 11, 2026 at 8:38 pm

Related Questions

In my current project, I am using four grid views in different tabs. As
Currently I have a custom tool which generates vanilla-SQL (only using standard SQL), from
I've inherited a code base and I'm writing a little tool to update a
Per this helpful article I have confirmed I have a connection pool leak in

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.