Note: In this document underlined hyperlinks link to VS .NET & VSHIK documentation. To make these links work you will need to either add "http://kb.helpwaregroup.com" to your IE Trusted sites zone, or download this page to your local drive (I'm assuming you have these collections installed). Otherwise you can copy the shortcut into Internet Explorer's address bar and click Go.
19-May-2002 - Initial upload.
2-June-2002 - Added 7b.
20-June-2002 - Added DevLang section to 1.
18-Mar-2003 - Append new information to section 6 on .HxA files.
20-Jul-2005 - MS recommends that you now plug into MS.VSIPCC.* under VS 2005 v8.0 and greater.
And the MS.VSCC.* collection for VS 2002 v7.0 and VS 2003 v7.1.
Dynamic help has been played down in VS v8.0 IDE (general search has been improved).
Setting up an H2 help project to work with
Visual Studio .NET's Dynamic Help Window
by Michael Waltuch from ESRI
When you work with the Visual Studo .NET integrated development environment (IDE) one way you can provide help for a Windows application (ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbtskprovidinghelpinapplication.htm) is through the use of the HelpProvider component. You can attach Help topics within a Help file (that is either of HTML or HTMLHelp 1.x or greater format) to specific controls on Windows Forms. At runtime you can display a help topic related to an element of your application's user interface by either clicking the element with the What's This cursor or setting focus to the element and then pressing F1. In addition you can use the HelpProvider component to provide Pop-up help (ms-help://MS.VSCC/MS.MSDNVS/vbcon/html/vbtskdisplayingpopuphelp.htm).
In addition to F1 help, Visual Studio .NET includes a new user assistance feature, the Dynamic Help Window. This window provides links to topics that are specific to the current area you are using or task you are trying to complete within the IDE. The IDE tracks the selections you make, the placement of the cursor, and the items with focus as you interact with what's on the screen. The Dynamic Help window then filters through the topics available in all collections that have been plugged into VS Help Collection (see Note#1) to display relevant information. So as you type or focus on different windows, the Dynamic Window updates the information available to you. Dynamic Help is particularly useful if your H2 help project documents an assembly with syntax, reference, samples, or how-to topics.
Make sure to read the current Visual Studio Help Integration Kit (VSHIK) whitepapers "Visual Studio .NET Help Integration" and "Integrating New Content with Dynamic Help". They discuss these features. The VSHIK documents are works in progress, but contain valuable information. If you don't have VSHIK, you can downloadit from MSDN. Here, we'll distill this information down to several essential steps. It should help you enable these features for your help system easily.
1. Determine which MSHelp attributes and values to place into your topics.
Attributes (see the VSHIK overview -- ms-help://MS.VSCC/ms.vshik/vshelpintegr/html/hxconAttributeOverview.htm) characterize the topics in your help project. Each attribute consists of a name-value pair used to describe various aspects of content within your Help file. Each attribute has a name and a set of possible values, and when used in conjunction with filters, makes it possible for users to selectively display the type of information they are interested in. In addition, each topic you want to point to in the Dynamic Help window must include some, if not all of the following attributes in the XML data island of the topic's HTML file. Two attributes must be inserted into a topic for it to be included in Dynamic Help: Locale andTopicType. Make sure each topic has one of:
In addition to these two required attributes, you can insert one of each of the following recommended MS-Help attributes per topic:
As you determine what attributes you'll add to your topics, add them and all potential values to an Attribute Definition (.HxA) file (ms-help://MS.VSCC/ms.vshik/mshlpwrk/html/hxgrfattributedefinitionfilehxa.htm)
2. Determine additional, custom attributes that you want to make available as criteria for filtering.
For example you might characterize each topic in your collection by whether it's geared to Beginner, Intermediate, or Advanced readers by establishing a SkillLevel attribute. Note, adding these additional attributes does not have any impact on Dynamic Help. Here is an example of a custom attribute:
<MSHelp:Attr Name="SkillLevel" Value="Beginner"/>
3. Determine which keywords to add to your topics.
You can add any number of keywords and keyword types to your topics or to the appropriate index file; however, only "F" keywords impact Dynamic Help. "F" keywords stored either in an .HxK file that has a Name property of "F" or that are inserted as an "F" Index Keyword in the XML data island of the topics themselves provide the link to the topic to be displayed.
4. Add all attribute markup and keywords to the XML data island of your topics.
The following is an example of the contents of an XML data island excerpted from a topic .htm file:
<xml> <MSHelp:Attr Name="DocSet" Value="MyTitle1"/> <MSHelp:Attr Name="Locale" Value="kbEnglish"/> <MSHelp:Attr Name="TargetOS" Value="Windows"/> <MSHelp:Attr Name="TopicType" Value="kbSyntax"/> <MSHelp:Attr Name="DevLang" Value="CSharp"/> <MSHelp:Attr Name="DevLang" Value="VB"/> <MSHelp:Attr Name="SkillLevel" Value="Beginner"/> <MSHelp:Keyword Index="A" Term="IAnimation properties"/> <MSHelp:Keyword Index="K" Term="Interval property"/> <MSHelp:Keyword Index="K" Term="IAnimation Interface, Interval property"/> <MSHelp:Keyword Index="F" Term="Interval"/> <MSHelp:Keyword Index="F" Term="IAnimation.Interval"/> <MSHelp:Keyword Index="F" Term="MyAssemblyNamespace.IAnimation.Interval"/> </xml>
The last three "F" Keywords in the sample XML data island above are examples of the kind of text that you've determined the help context provider (Visual Studio .NET's Code Editor window, for example) will emit if you select or position your cursor on some text. To determine what text the help context emits for your code or user interface elements, see the section below named "How to determine what the context emits". If the context emits any of the strings you specify as an "F" keyword, a link to any topic that contains that keyword will appear in the Dynamic Help window. By default, the topic's <TITLE> text will appear in the Dynamic Help window. If you prefer, you can specify an RLTitle attribute in the XML data island. This text will then display in the Dynamic Help window instead of the <TITLE> text:
<MSHelp:RLTitle Title="Link displayed in Dynamic Help window"/>
5. How to determine what the context emits
To view the context (attributes and keywords) that is pushed by the environment to the Dynamic Help window, set the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.0\Dynamic Help HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\Dynamic Help -- for VS .NET 2003 HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\Dynamic Help -- for VS .NET 2005 etc
so that the ValueName Display Debug Output in Retail
is set to YES
.
After you restart Visual Studio .NET, the attributes and keywords output appear in the Dynamic Help window below the list of Help topics:
The text that appears after the [F1 Kwd] in Visual Basic projects or as in the illustration above, after the [F1 Kwd CS] in C# projects, is the text to add as the "F" keyword in your topics. So, for example the System.Diagnostics Namespace topic has the following keyword in its XML data island:
<MSHelp:Keyword Index="F" Term="System.Diagnostics"/>
Note that if an "F" Index Keyword is not found, Dynamic Help searches the "K" Index Keyword list for matches. As you can see in the illustration these keyword types are pushed as [Kwd].
To disable the debugging state, change the registry key back to NO
.
6. Add attribute schema to .HxA files.
This is a critical step. You must have an attribute definition file (.HxA) at the collection level (.HxC) and at the title level (.HxS) of your help project. The collection level HxA is a superset of all the title level .HxA files. If you want you can simply use a copy of the collection-level .HxA (inserting the appropriate DTD) at the title level; however, the .HxA at the title level can include attributes that are specific to the title. Here's a collection level .HxA, containing all schema for all titles:
<?xml version="1.0"?> <!DOCTYPE HelpAttributes> <HelpAttributes DTDVersion="1.0"> <AttName Id="1" Name="DocSet" Display="Yes" UIString="Acme Help Collection" AttType="Enum"> <AttVal Id="1_1" Name="MyTitle1" Display="Yes" UIString="First Title Help" /> <AttVal Id="1_2" Name="MyTitle2" Display="Yes" UIString="Second Title Help" /> <AttVal Id="1_3" Name="MyTitle3" Display="Yes" UIString="Third Title Help" /> </AttName> <AttName Id="2" Name="DevLang" Display="Yes" UIString="DevLang" AttType="Enum"> <AttVal Id="2_1" Name="CSharp" Display="Yes" UIString="CSharp" /> <AttVal Id="2_2" Name="VB" Display="Yes" UIString="Visual Basic" /> </AttName> <AttName Id="3" Name="Locale" Display="No" UIString="Locale" AttType="Enum"> <AttVal Id="3_1" Name="kbEnglish" Display="No" UIString="English" /> </AttName> <AttName Id="4" Name="TargetOS" Display="No" UIString="TargetOS" AttType="Enum"> <AttVal Id="4_1" Name="Windows" Display="No" UIString="Windows" /> </AttName> <AttName Id="5" Name="TopicType" Display="No" UIString="TopicType" AttType="Enum"> <AttVal Id="5_1" Name="kbArticle" Display="No" UIString="Article" /> <AttVal Id="5_2" Name="kbHowTo" Display="No" UIString="How To" /> <AttVal Id="5_3" Name="kbSyntax" Display="No" UIString="Syntax" /> </AttName> </HelpAttributes>
18-Mar-2003 .HxA Update
MS now recommend the following in regards to using .HxA attribute definition files.
For further discussion on using attribute files please see H2 Attributes & Filters
7. Adding a custom LinkGroup for your topics in the Dynamic Help window
Each of the illustrations of the Dynamic Help window above, showed the standard Link Groups into which MS.VSCC places topics: Help, Samples, Getting Started. You may want to highlight your topics or make them easier to find by creating one or more custom groups into which to place your topics. To create a custom link group for all or some of your topics, do the following:
Here's an example of a custom LinkGroup in the Dynamic Help window:
8. Walkthrough
You can see a simple example of Dynamic Help if you download FAR's H2Reg utility. The H2 version of the H2Reg Help file includes two topics that can be displayed in the context of a Visual Studio .NET Windows Application project (either VB .NET or C#). To see the example, follow these steps:
System.Windows.Forms.Form
or System.Windows.Forms.Button
a custom LinkGroup and a link to a relevant topic will appear in the Dynamic Help window.
9. Plug your help collection into VS Help Collection
In order for users of your help project to take advantage of Dynamic Help window assistance, you must, of course, plug your help collection into the Visual Studio .NET Help Collection (See Note#1 below). One way to do this is to use FAR's H2Reg utility. If you add a custom LinkGroup, your setup program must install the .xml file in which you specified the ID and Title into
%programfiles%\Microsoft Visual Studio .NET\Common7\IDE\HTML\XMLLinks\1033
See Note (8.a) above
Note#1: For MS VS 2005 (v8.0) and greater MS now recommend you plug into MS.VSIPCC instead of MS.VCSS. This keeps 3rd party collections grouped together and out of the way of core collection files (for stability).
10. Using Dynamic Help
Once you've plugged your help collection into the VS Help Collection, you can use Dynamic Help in concert with your assembly or application. As you move the cursor into a context, the Code Window, for example, you'll see how the Dynamic Help window changes. At this point you can either press F1 to get the first topic listed in the Help section, or you can click any one of the links in the window.
Tip: Here is the recommended way to find the path to the VS .NET LinkGroup folder:
{reg:HKLM\SOFTWARE\Microsoft\VisualStudio\7.0} value InstallDir,
then add "html\xmllinks\lcid" (eg. html\xmllinks\1033)
for VS .NET 2003 this would be
{reg:HKLM\SOFTWARE\Microsoft\VisualStudio\7.1} value InstallDir,
then add "html\xmllinks\lcid" (eg. html\xmllinks\1033)
for VS .NET 2005 this would be
{reg:HKLM\SOFTWARE\Microsoft\VisualStudio\8.0} value InstallDir,
then add "html\xmllinks\lcid" (eg. html\xmllinks\1033)
Note: The H2Reg demo installs a copies HelpWare.xml to a fixed path of
%programfiles%\Microsoft Visual Studio .NET\Common7\IDE\HTML\XMLLinks\1033
If this is not the location of your VS .NET then please copy the file manually.