Partager via


Displaying F1 Help for a Dialog Box or Menu Option

When an MFC application is enabled for context sensitive help in HTMLHelp format, you can provide for the display of a topic when a user presses F1 on a menu option or on a dialog box.

To manually make the HTML Help viewer display

  1. Assuming a dialog box with an ID of IDD_MYDLG, add the following alias to the project's .hhp file: HIDD_MYDLG = HID_APP_MYDLG.htm.

  2. Add the following to hlp\afxcore.htm:

    <OBJECT type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e" VIEWASTEXT>
    <param name="New HTML file" value="hid_app_mydlg.htm">
    <param name="New HTML title" value="MyDlg command (Help menu)">
    </OBJECT>
    <P>Help text goes here.</P>
    

The same procedure will work if the ID is that of a menu option.

See Also

Concepts

HTML Help: Context-Sensitive Help for Your Programs

Displaying Context-Sensitive Help

CWinApp::EnableHtmlHelp

CWnd::HtmlHelp

CWinApp::HtmlHelp