// in your FormViews header file
afx_msg LRESULT OnHelpHitTest(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
// in your FormViews MESSAGE_MAP
ON_MESSAGE(WM_HELPHITTEST, OnHelpHitTest)
ON_MESSAGE(WM_COMMANDHELP, OnCommandHelp)
// Your views class function
LRESULT CYourFormView::OnHelpHitTest(WPARAM wParam, LPARAM lParam)
{
// message is sent to us as follows:// dwContext = ::SendMessage(hWnd, WM_HELPHITTEST,0,MAKELONG(point.x, point.y));// WPARAM = 0 ;// LPARAM = Point clicked
CPoint p((DWORD)lParam) ;
ClientToScreen(&p) ;
CWnd *pWnd = WindowFromPoint(p) ;
if (pWnd != NULL)
{
// convert to correct help ID, see makehelp.batif (pWnd == this)
return IDD + 0x20000 ;
elsereturn pWnd->GetDlgCtrlID() + 0x60000 ; // see later about 0x60000
}
return0 ; // failed!
}
LRESULT CContextHelpView::OnCommandHelp(WPARAM wParam, LPARAM lParam)
{
// message is sent to us as a test to see whether we make WinHelp appear// return non-zero if we process the message// wParam = 0, not used// lParam = 0, not used
CWnd *pWnd = GetFocus();
if (pWnd != NULL)
{
DWORD helpID;
// convert to correct help IDif (pWnd == this)
helpID = IDD + 0x20000 ;
else
helpID = pWnd->GetDlgCtrlID() + 0x60000 ;
// we have a control with the focus, pop-up help for it
span>
AfxGetApp()->WinHelp(helpID);
return TRUE;
}
return FALSE; // let default handling process it
}
${\footnote Button 4 topic}
K{\footnote Button 4 topic}
#{\footnote HIDC_BUTTON4}
{\b Button 4 topic}\line
This comes up when you click on button 4for context help\par
\line
\page