How we can set position of ballon tooltip in mfc(its moving with respect to mouse i wnat to make it to static or just near to my edit control).
hwndToolTip = CreateWindowEx(NULL, TOOLTIPS_CLASS, NULL,
WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX | TTS_BALLOON,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
this->m_hWnd, NULL,
NULL, NULL);
if (hwndToolTip != NULL)
{
//TOOLINFO ti = {0};
ti.cbSize = sizeof (ti);
//ti.uFlags = TTF_TRANSPARENT | TTF_ABSOLUTE;
ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS ;//| TTF_ABSOLUTE;
ti.hwnd = this->m_hWnd;
ti.uId = (UINT) ::GetDlgItem(this->m_hWnd, IDC_EDIT1);//0;IDC_EDIT1
ti.hinst = NULL;
ti.lpszText = _T("user defined");
::GetClientRect (this->m_hWnd, &ti.rect);
::GetClientRect(GetDlgItem(IDC_EDIT1)->m_hWnd, &ti.rect);
::SendMessage (hwndToolTip, TTM_TRACKACTIVATE, FALSE, (long) &ti);//To close previous tooltip if any
//::SendMessage(hwndToolTip, TTM_TRACKPOSITION,0, MAKELONG(0, 0));
::SendMessage (hwndToolTip, TTM_ADDTOOL, 0, (long) &ti);
::SendMessage (hwndToolTip, TTM_SETDELAYTIME, TTDT_AUTOMATIC, -1);
::SendMessage (hwndToolTip, TTM_SETMAXTIPWIDTH, 0, 500);
::SendMessage (hwndToolTip, TTM_TRACKACTIVATE, TRUE, (long) &ti);