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 ?