Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - Tooltip on a window with no controls
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tooltip on a window with no controls

 Post Reply Post Reply
Author
Message
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post Topic: Tooltip on a window with no controls
    Posted: 29 December 2008 at 1:05pm
I have a window that simply displays a bitmap. It has no controls in it. I am asked to show a tooltip on the window. So I called EnableToolTips and overrode OnToolHitTest and when called I call FillInToolInfo.
 
I am doing the following in OnToolHitTest:

pTI->hwnd = m_hWnd;

pTI->uId = (WPARAM)m_hWnd;

pTI->uFlags |= TTF_IDISHWND;

CRect rect;

rect.SetRectEmpty();

GetClientRect( &rect );

CXTPToolTipContext::FillInToolInfo( pTI, pTI->hwnd, rect, pTI->uId, m_strTooltilDescription, m_strTooltipTitle, m_strTooltilDescription );

The tip appears just fine until the user moves the frame window or clicks on the command ribbon bar (in gray space). After that, my tip will not display. I have to click in some other window (say a docking pane) or as I have found I can move the mouse over a docking pane. Then I can move back over my window and get the tip to display.
 
I have also tried not setting TTF_IDISHWND and always returning a unique uId (in this case tip flashes constantly or does not display).
 
I have stepped out of OnToolHitTest and thru the code after that call in FilterToolTipMessageHelper. Everything appears to be fine except the tip doesn't show up (I have stepped thru the code when the tip displays and when it will not and see no differences in code flow).
 
What am I doing wrong?
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.156 seconds.