none
F1Help request handling for project properties page RRS feed

  • Question

  • Hello!

    I've created custom project type, and added one project properties page for it. It works great, but now I need to provide a custom help for this page, which had to be shown on F1 key press.

    I tried to use IPropertyPage.Help(string pszHelpDir) method, which, I supposed, had to be invoked on Help request. But I faild, because it is never been invoked, dispite help has been show, but common topic ("Deciding Which Technologies and Tools To Use").

    I thougth that it could be a problem in my project,  but for  IronPython project sample from SDK result was the same, I didn't managed to invoke SettingsPage.Help method after F1 key pressing.

    Am I wrong in IPropertyPage.Help() method usage?

    How can I customize help request for project properties page?

    Thanks a lot.
    Monday, June 2, 2008 2:09 PM

Answers

  • I ran across this same problem a few years back, and I suspect the implementation hasn't changed in the last couple of releases. The only way to display a custom help topic from the Tools.Options dialog, is to have a Help 2.0 project with your topic merged into the MSDN Help, with an appropriate F1 keyword.

    When a user clicks on the help button (or uses F1), the shell creates a string based upon where the active property page sits in the hierarchy of the tree control displayed on the left side of the Tools.Options dialog. This position also corresponds to where the property page is registered in the registry. Property pages displayed in the Tools.Options dialog are registered in the registry under:

       HKLM\Software\Microsoft\VisualStudio\<ver>\ToolsOptionsPages

    After the shell constructs this help string, it invokes IVsHelp::DisplayTopicFromF1Keyword, to display the help topic. It's this string that needs to be added as an F1 keyword to map the help button to the desired help topic.

    As mentioned above, where the property page is registered under the above mentioned registry location, determines the keyword needed to associated a specific help topic merged into the MSDN help.

    For example:

    When you invoke the Tools.Options dialog, select the "Debugging\Native" property page, and click the help button (or hit F1), the shell calls IVsHelp::DisplayTopicFromF1Keyword with the index string "VS.ToolsOptionsPages.Debugger.Native", which corresponds to the HKLM\Software\Microsoft\VisualStudio\<ver>\ToolsOptionsPages\Debugger\Native registry key.

    So if you had your own property page registered under HKLM\Microsoft\VisualStudio\8.0\ToolsOptionsPages\AllowParams Package\Settings, the F1 index string in your help project would need to be "VS.ToolsOptionsPages.AllowParams Package.Settings"

    It's important to point out that the naming scheme used here is not always consistent with the registry key path as mentioned above. Specifically, the shell constructs a slightly different index string for pages located under the "Text Editor" key. For example, if you have a property page registered under HKLM\Software\Microsoft\VisualStudio\<ver>\ToolsOptionsPages\Text Editor\F#\General, you would need to stipulate a keyword index of "VS.ToolsOptionsPages.Text_Editor.F#.General". Note the underbar in "Text_Editor". This is a special case for property pages listed under the "Text Editor" category.

    For your own page, you'll want to review where it sits in the registry, the ensure you have the proper F1 keyword for your help topic (built with MS Help 2.0) and merged into the MSDN help. Then the F1 key should navigate you to your help topic.

    Sincerely,


    Ed Dore
    Monday, June 2, 2008 6:03 PM
    Moderator