1. Add the following line to the message map in the header file of the dialog box
afx_msg BOOL OnToolTipText(UINT nID, NMHDR* pNMHDR, LRESULT* pResult);
2. Add the following line to the cpp file of the dialog box
ON_NOTIFY_EX(TTN_NEEDTEXT, 0, OnToolTipText )
3. Add following line to InitDialog()
EnableTooltips();
4. Add the following function
BOOL CConfBrowser_MFCDlg::OnToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR;
UINT nID =pNMHDR->idFrom;
if (pTTT->uFlags & TTF_IDISHWND)
{
// idFrom is actually the HWND of the tool
nID = ::GetDlgCtrlID((HWND)nID);
}
if (nID)
{
pTTT->lpszText = MAKEINTRESOURCE(nID);
pTTT->hinst = AfxGetResourceHandle();
return(TRUE);
}
return(FALSE);
}
No comments:
Post a Comment