1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| BOOL CToolTipCtrl::AddTool(CWnd* pWnd, LPCTSTR lpszText, LPCRECT lpRectTool,
UINT_PTR nIDTool)
{
ASSERT(::IsWindow(m_hWnd));
ASSERT(pWnd != NULL); // ligne 139
ASSERT(lpszText != NULL);
// the toolrect and toolid must both be zero or both valid
ASSERT((lpRectTool != NULL && nIDTool != 0) ||
(lpRectTool == NULL) && (nIDTool == 0));
TOOLINFO ti;
FillInToolInfo(ti, pWnd, nIDTool);
if (lpRectTool != NULL)
{
Checked::memcpy_s(&ti.rect, sizeof(RECT), lpRectTool, sizeof(RECT));
}
ti.lpszText = (LPTSTR)lpszText;
return (BOOL) ::SendMessage(m_hWnd, TTM_ADDTOOL, 0, (LPARAM)&ti);
} |
Partager