Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Displaying tooltip

Displaying tooltip

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ashtwin
    wrote on last edited by
    #1

    Hi, i want to display a tooltip when the mouse pointer is over a specific part of window. I am using the following code

    if(IsResizable(ptHit))
    {
    //CRect boundingBox;
    //BOOL rval = TRUE;
    if (::IsWindow(mToolTip.GetSafeHwnd()))
    {
    mToolTip.UpdateTipText(_T("Resizing not possible"), this, 60000);
    mToolTip.Activate(TRUE);
    }
    else
    {
    BOOL rVal = TRUE;
    rVal = mToolTip.Create(this, TTS_ALWAYSTIP);
    if(rVal)
    {
    BOOL result = mToolTip.AddTool(this, _T("Resizing not possible"), CRect(100, 150, 200, 200), 60000);
    if(result)
    {
    mToolTip.Activate(TRUE);
    }
    }
    }
    }

    But the tooltip is not coming. Thanks

    V 1 Reply Last reply
    0
    • A ashtwin

      Hi, i want to display a tooltip when the mouse pointer is over a specific part of window. I am using the following code

      if(IsResizable(ptHit))
      {
      //CRect boundingBox;
      //BOOL rval = TRUE;
      if (::IsWindow(mToolTip.GetSafeHwnd()))
      {
      mToolTip.UpdateTipText(_T("Resizing not possible"), this, 60000);
      mToolTip.Activate(TRUE);
      }
      else
      {
      BOOL rVal = TRUE;
      rVal = mToolTip.Create(this, TTS_ALWAYSTIP);
      if(rVal)
      {
      BOOL result = mToolTip.AddTool(this, _T("Resizing not possible"), CRect(100, 150, 200, 200), 60000);
      if(result)
      {
      mToolTip.Activate(TRUE);
      }
      }
      }
      }

      But the tooltip is not coming. Thanks

      V Offline
      V Offline
      Varghese Paul M
      wrote on last edited by
      #2

      Call method EnableToolTips(). Capture message TTN_NEEDTEXT. Add ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify) in the message map and implement method OnToolTipNotify.

      cheers Varghese Paul

      A 1 Reply Last reply
      0
      • V Varghese Paul M

        Call method EnableToolTips(). Capture message TTN_NEEDTEXT. Add ON_NOTIFY_EX( TTN_NEEDTEXT, 0, OnToolTipNotify) in the message map and implement method OnToolTipNotify.

        cheers Varghese Paul

        A Offline
        A Offline
        ashtwin
        wrote on last edited by
        #3

        Hi, Thanks for replying. Actually it was my fault because the coordinates which i was using as boundry for tooltip were not correct.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups