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. CToolTipCtrl with TTF_TRACK Flag won't disappear, SetDelayTime doesn't work?

CToolTipCtrl with TTF_TRACK Flag won't disappear, SetDelayTime doesn't work?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
1 Posts 1 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.
  • F Offline
    F Offline
    Falconapollo
    wrote on last edited by
    #1

    I found if set TTF_TRACK flag to CTooltipCtrl, SetDelayTime doesn't work anymore, so the tooltip won't disappear automatically. I want to show the tooltip just below specified control, and expect it to disappear after a few seconds(the time can set with SetDelayTime). Anybody can help me? Here is my steps to construct tool tip:1. Add member variable CToolTipCtrl m_tooltip; 2. override PreTranslateMessage BOOL CPF_GetSetNameDlg::PreTranslateMessage( MSG* pMsg ) { switch (pMsg->message) { case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: case WM_LBUTTONUP: case WM_RBUTTONUP: case WM_MBUTTONUP: case WM_MOUSEMOVE: m_tooltip.RelayEvent(pMsg); break; } return CDialog::PreTranslateMessage(pMsg); } 3. OnInitialDialog BOOL CPF_GetSetNameDlg::OnInitDialog() { CDialog::OnInitDialog(); //tooltip EnableToolTips(); m_tooltip.Create(this , WS_POPUP | TTS_NOPREFIX | TTS_BALLOON); m_tooltip.SetDelayTime(TTDT_INITIAL, 0); m_tooltip.SetDelayTime(TTDT_AUTOPOP, 30000); m_tooltip.SetDelayTime(TTDT_RESHOW, 30000); m_tooltip.AddTool(GetDlgItem(IDC_SETNAME), _T("")); m_tooltip.SetMaxTipWidth(600); } 4. Control to show tool tip if(bShow) { m_tooltip.UpdateTipText(_T("Hello, money!"), pWnd); CToolInfo sTinfo; m_tooltip.GetToolInfo(sTinfo, pWnd); sTinfo.uFlags = TTF_TRACK; m_tooltip.SetToolInfo(&sTinfo); CRect rect; pWnd->GetWindowRect(rect); m_tooltip.SendMessage(TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rect.left, rect.bottom)); m_tooltip.SendMessage(TTM_TRACKACTIVATE, TRUE, (LPARAM)&sTinfo ); }

    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