https://docs.microsoft.com/zh-cn/cpp/mfc/reference/ctooltipctrl-class
1.在對(duì)話框類中添加成員變量
CToolTipCtrl m_ttc;
2.在OnInitDialog()中初始化
m_ttc.Create(this);
m_ttc.AddTool(GetDlgItem(IDC_BUTTON1), _T("1"));
3.重寫PreTranslateMessage(MSG* pMsg)
BOOL CcalculatorDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加專用代碼和/或調(diào)用基類
m_ttc.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}