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

  • SEARCH
  • Home
  • 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 8571825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:52:02+00:00 2026-06-11T18:52:02+00:00

I am using MFC CToolTipCtrl for creating tooltip for a button. Now I have

  • 0

I am using MFC CToolTipCtrl for creating tooltip for a button. Now I have problem when I run the application in Windows XP.When I place mouse over the button,tooltip will popup but after clicking the button no tooltip is shown.In windows 7 there is no such problem. I’ve used the following code to create tooltip

pToolTip->Create(this);

TOOLINFO ToolInfo;
ToolInfo.cbSize     = sizeof(TOOLINFO);
ToolInfo.lpszText   = const_cast<LPTSTR>(szToolTipText);
ToolInfo.hinst      = AfxGetInstanceHandle();
ToolInfo.hwnd       = pButton->m_hWnd;
ToolInfo.uFlags     = TTF_SUBCLASS | TTF_IDISHWND;
ToolInfo.uId        = (UINT)pButton->m_hWnd;

pToolTip->SendMessage(TTM_ADDTOOL, 0, (LPARAM) &ToolInfo);
  • 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. Editorial Team
    Editorial Team
    2026-06-11T18:52:04+00:00Added an answer on June 11, 2026 at 6:52 pm

    Try call relayevent in the preTanslateMessage function.

    From MSDN: http://msdn.microsoft.com/en-US/library/x61cthdf(v=vs.80).aspx

    In order for the tool tip control to be notified of important messages, such as WM_LBUTTONXXX messages, you must relay the messages to your tool tip control. The best method for this relay is to make a call to CToolTipCtrl::RelayEvent, in the PreTranslateMessage function of the owner window.

    The following example illustrates one possible method (assuming the tool tip control is called m_ToolTip):

    if(pMsg->message== WM_LBUTTONDOWN ||
            pMsg->message== WM_LBUTTONUP ||
            pMsg->message== WM_MOUSEMOVE)
    m_ToolTip.RelayEvent(pMsg);
    
    return CMyView::PreTranslateMessage(pMsg);
    

    If you’re using VS2010 above, you can just use CMFCButton, it has a method to set the tooltip, makes life much easier.

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

Sidebar

Related Questions

I'm creating a Windows Mobile 6 application using MFC Single Document Interface with CFormView
I have a windows application in visual C++. I am not using MFC, in
Problem I have a strange problem. I have written an application in MFC(using VS2003)
I am using MFC CFile Seek function. I have a problem about Seek out
How can I print a document using MFC Dialog Based Application? I have made
I have an application which is created using MFC and I have created a
I have C++ application which has UI developed using MFC, does some networking using
I am developing a Windows API application without using MFC . I am using
I have a window application in visual c++. I am not using MFC I
I have developed a quite large application using MFC. Naturaly, I used GDI for

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.