Print Page | Close Window

Tooltip on a window with no controls

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=13032
Printed Date: 17 June 2024 at 4:19am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tooltip on a window with no controls
Posted By: rdhd
Subject: Tooltip on a window with no controls
Date 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?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net