Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - TTM_UPDATETIPTEXT don't work!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

TTM_UPDATETIPTEXT don't work!

 Post Reply Post Reply
Author
Message
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Topic: TTM_UPDATETIPTEXT don't work!
    Posted: 27 February 2014 at 9:01am
We like to show a tooltip depends on key state.

Sample use case:
Tooltip over a link (like in an internet browser).
Mouse over a link shows "follow link"
STRG+Mouse over a link shows "follow link a new tab"

But we have serveral problems:

a) if mouse is over a link and you press STRG after, the tooltip is to be destroyed!?
This happends because you scan for key strokes!? (system tooltip don't hide if pressing a key)

        BOOL bKeys = (message >= WM_KEYFIRST && message <= WM_KEYLAST) ||
            (message >= WM_SYSKEYFIRST && message <= WM_SYSKEYLAST);

        if ((bKeys ||
            (message == WM_LBUTTONDOWN || message == WM_LBUTTONDBLCLK) ||
            (message == WM_RBUTTONDOWN || message == WM_RBUTTONDBLCLK) ||
            (message == WM_MBUTTONDOWN || message == WM_MBUTTONDBLCLK) ||
            (message == WM_NCLBUTTONDOWN || message == WM_NCLBUTTONDBLCLK) ||
            (message == WM_NCRBUTTONDOWN || message == WM_NCRBUTTONDBLCLK) ||
            (message == WM_NCMBUTTONDOWN || message == WM_NCMBUTTONDBLCLK)))
        {
            CancelToolTips();
        }


b) if the new text was calculated in OnToolHitTest(CPoint point, TOOLINFO* pTI) and written to pTI->lpszText, the base class doesn't modify the tooltip!
If I manually call TTM_UPDATETIPTEXT, I saw that the string was internally updated in array m_arrTools but no recalculation and redraw action follows (like system tooltip)!!!!!!!
A manually redaw don't neither work, because the OnPaint() method reads the old string from m_toolVisible.

Please support changes of tooltip text while it is displayed! Thanks
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.145 seconds.