//  TestButton.h
class CTestButton : public CWindowImpl<CTestButton>  
{
    ......
    // tooltip
    HWND m_hwndToolTip;
    TOOLINFO m_tiTip;    ......
    LRESULT OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
    void CreateToolTip();
    ......
}// TestButton.cpp
HWND g_hwndToolTip = NULL;CTestButton::CTestButton()
{
    ......
    CreateToolTip();
}void CTestButton::CreateToolTip()
{
    INITCOMMONCONTROLSEX   icex;    icex.dwSize   =   sizeof(icex);
    icex.dwICC    =   ICC_BAR_CLASSES;    if (!InitCommonControlsEx(&icex))
return;    m_hwndToolTip = ::CreateWindow(TOOLTIPS_CLASS,         _T(""),       WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,      CW_USEDEFAULT, CW_USEDEFAULT,       CW_USEDEFAULT, CW_USEDEFAULT,      NULL,       NULL,       GetModuleHandle(NULL),       NULL);    ::SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, 
                   SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);    m_tiTip.cbSize = sizeof(TOOLINFO);
    m_tiTip.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_ABSOLUTE;
    m_tiTip.hwnd = m_hWnd;
    m_tiTip.hinst = GetModuleHandle(NULL);
    m_tiTip.uId = (UINT)g_hwndToolTip;
    m_tiTip.lpszText = _T("my button");

    if (!::SendMessage(m_hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&m_tiTip))
    {
MessageBox(_T("couldn't create tooltip"));
    }

    ::SendMessage(m_hwndToolTip, TTM_TRACKACTIVATE, (WPARAM)true, 
                  (LPARAM)&m_tiTip);
}LRESULT CTestButton::OnNotify(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& /*bHandled*/)
{
    LPNMHDR lpnmhdr;
    LPNMTTDISPINFO lpttd;    lpnmhdr = (LPNMHDR)lParam;

    if (lpnmhdr->code == TTN_GETDISPINFO)
    {
lpttd = (LPNMTTDISPINFO)lpnmhdr;
wcscpy(lpttd->szText, _T("aaaaa"));
    }
    return 0;
}LRESULT CTestButton::OnMouseMove(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM lParam, BOOL& bHandled)
{
    ::SendMessage(m_hwndToolTip, TTM_TRACKACTIVATE, 0, (LPARAM)MAKELPARAM(m_pt.x+10, m_pt.y+10));
}我自己写了一个按钮,想让鼠标移到按钮上时显示tooltip,
为什么没出来呢??
高人帮帮忙,谢谢