How to: Provide Context for Modal and Modeless Dialog Boxes

Modal and modeless dialog boxes listen into user actions related to the dialog boxes, and when the user presses F1 or clicks the Help button, the dialog box passes along a unique F1 keyword. To provide F1 Help for a modal or modeless dialog box, use the following procedure.

To provide an F1 keyword for modal or modeless dialog boxes

  1. Call QueryService on the SID_SVsHelp service.

    A pointer to the Help interface is returned.

  2. Call DisplayTopicFromF1Keyword, passing the F1 keyword value.

    When the user presses F1 or clicks the Help button on the dialog box, the Help topic is opened in a document window. F1 topics from a dialog box are not displayed in the list of topics within the Dynamic Help window.

    Modal dialog boxes must use unique keywords for their F1 Help, so there are no conflicts to resolve. For more information, see F1 Keywords Overview.

    Note

    The environment automatically pushes the programmatic identifier (ProgID) of the active property page as a keyword to the Dynamic Help window. It also pushes the ProgID if the Help button for the page is clicked and the page does not handle the Help message.

  • Only one F1 keyword is provided for a modal or modeless dialog box using the Help::DisplayTopicFromF1Keyword method. Lookup keywords and attributes are not provided for dialog boxes.

See Also

Other Resources

Connecting Context-Sensitive Help