I wantThe CFormView class SDI application adds real context help, but fails.
A: You should overload the OnHelpHitTest function of the CMyFormView class:
LRESULT CMyFormView: OnHelpHitTest (WPARAM, LPARAM lParam)
{
LRESULT lResult = (LRESULT) 0x00;
CWnd * pWndChild = ChildWindowFromPoint (Cpoint (lParam), CWP_ALL | CWP_SKIPINVISIBLE );
If (pWndChild &: IsWindow (pWndChild-> m_hWnd ))
{
LResult =: GetWindowLong (pWndChild-> m_hWnd, GWL_ID );
If (lResult)
LResult + = HID_BASE_COMMAND;
}
If (lResult = (LRESULT) 0x00)
LResult =: GetWindowLong (m_hWnd, GWL_ID) + HID_BASE_RESOURCE;
Return lResult;
}
Then you can use the help files you usually use.To ensure the correct prefix, see TN028: Context-Sensitive Help Support.
For example:
ID_SOME_MENU_ITEM_OR_COMMAND_BUTTON
IDR_SOME_WINDOW_OR_DIALOG
IDP_PROMPT
IDW_CONTROL_THAT_IS_NOT_A_COMAND_BUTTON
Make sure thatID is included in the file resource. hm.