CToolTipCtrl m_tip;//定义一个变量名
m_tip.Create(this);
m_tip.SetDelayTime(100); //设置延迟
m_tip.SetFont(&m_StaticFont);
m_tip.SetTipTextColor(RGB(0, 0, 255)); //设置提示文本的颜色
m_tip.SetTipBkColor(RGB(255, 255, 255)); //设置提示框的背景颜色
m_tip.Activate(TRUE); //设置是否启用提示
//添加显示的文字
m_tip.AddTool(GetDlgItem(IDC_BUTTON1), str);
//调用函数
BOOL CLAtoBarcodeDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
if (pMsg->message == WM_MOUSEMOVE)
m_tip.RelayEvent(pMsg);
return CDialogEx::PreTranslateMessage(pMsg);
}