Article ID: 140595
Article Last Modified on 12/2/2003
"Status bar text\nTool Tip Text"
// Each control on the form view has an associated
// string resource with the same ID in the string table of
// this application.
// Message Map for CFormView derived class
BEGIN_MESSAGE_MAP(CMyFormView, CFormView)
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT,0,0xFFFF,OnToolTipNotify)
END_MESSAGE_MAP()
//Notification handler - add entry to class definition
BOOL CMyFormView::OnToolTipNotify(UINT id, NMHDR *pNMH,
LRESULT *pResult)
{
TOOLTIPTEXT *pText = (TOOLTIPTEXT *)pNMH;
int control_id = ::GetDlgCtrlID((HWND)pNMH->idFrom);
if(control_id)
{
pText->lpszText = MAKEINTRESOURCE(control_id);
pText->hinst = AfxGetInstanceHandle();
return TRUE;
}
return FALSE;
}
void CKbtestView::OnInitialUpdate()
{
CFormView::OnInitialUpdate();
EnableToolTips(TRUE);
}
Additional query words: kbVC400bug
Keywords: kbbug kbfix kbtooltip kbuidesign kbdocfix kbui kbvc500fix kbdocerr kbcode KB140595