|
-
March 30th, 1999, 06:48 AM
#1
Problem : Tooltips in CTreeView
I'm trying to change the text that appears in the tooltip of treeitems
in a CTreeView.
This is the code I wrote in the PreTranslateMessage :
BOOL CMyTreeView::PreTranslateMessage(MSG* pMsg)
{
CToolTipCtrl *pToolTip = GetTreeCtrl().GetToolTips();
if ( pToolTip )
{
CPoint Point(LOWORD(pMsg->lParam), HIWORD(pMsg->lParam));
UINT flag;
HTREEITEM hItem = GetTreeCtrl().HitTest(Point, &flag);
if ( hItem != NULL )
{
if ( flag & TVHT_ONITEM )
{
pToolTip->UpdateTipText("My tooltip", &GetTreeCtrl());
pToolTip->RelayEvent(pMsg);
}
else
pToolTip->Pop();
}
}
}
I don't use the TV
The pToolTip is not null. But the tooltip is never showed.
What am I doing wrong ?
-
August 24th, 1999, 03:22 AM
#2
Re: Problem : Tooltips in CTreeView
Hello Franky,
I just noticed your problem with treeview problem.
You can solve this problem in this way:
First of all when creating tree view in Create
function you must add style TVS_INFOTIP to the tree view. Then you are available to handle TVN_GETINFOTIP notification message. This is
handler function:
void CTreeViewToolltipView::OnGetTooltipText(NMHDR* pNMHDR, LRESULT* pResult)
{
NMTVGETINFOTIP *lpGetInfoTip = (PNMTVGETINFOTIP)pNMHDR;
strcpy(lpGetInfoTip -> pszText,
"My tooltip");
*pResult = 0;
}
in this function you can modify structure lpGetInfoTip.
Greetings
================
Greetings
Marius Bakelis
[email protected]
=================
Regards,
Marius Bakelis
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|