Click to See Complete Forum and Search --> : move tooltip to another position


gus
March 29th, 1999, 03:33 AM
In my application, I add a dialog bar with some fields with tooltip also. The tooltip are generated using the default

CToolTipCtrl inside the dialog bar, and I change the text intercepting the message TTN_NEEDTEXT, with something like

this:

BOOL CMyDlgBar::OnToolTipNeedText( UINT id, NMHDR *pNMHDR, LRESULT *pResult )

{

BOOL bHandleNotify = FALSE;

TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;

UINT pos;

nID = ::GetDlgCtrlID( (HWND)pNMHDR->idFrom );

switch( nID )

{

case IDC_FLD1:

pTTT->lpszText = "my tooltip;

bHandleNotify = TRUE;

break;

}

return bHandleNotify;

}

The tooltip default position is centered and under the field: does anybody knows how I can move it to another position

(ie to the left of the field) ?

Thanks everybody

Lavrent
November 3rd, 1999, 07:11 AM
BOOL ::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )

...........

::MoveWindow( pNMHDR->hwndFrom,
nX,
nY,
nWidth,
nHeight,
bRepaint);

..........