In this topic
- Creating the WinHelp file
- Setting custom command properties
- Using the custom command and viewing the context help
Creating the WinHelp file
To create the WinHelp file, perform the following steps:
- Compose the context-sensitive help in a rich text format (RTF) file including a topic ID in the #Footnote of the RTF file (for example, #MyFullExtent_Command).
- Create a help project (HPJ) file using a free downloadable product, such as Microsoft Help Workshop, and add the RTF file to the project.
- Determine a numeric help ID (for example, 1234) that you can use in your custom command to link to the topic ID specified in the RTF footer. You can use Microsoft Help Workshop to add this numeric value by opening the .hpj file, clicking Map, then clicking Add (to add the mapping for an individual topic).
- In Microsoft Help Workshop, compile the .hpj file to create the WinHelp file; for example, MyHelpFile.hlp.
Setting custom command properties
In the command constructor of a command or tool that implements BaseCommand or ICommand, assign the help ID and the help file name as shown in the following code example:
[C#] public MyCommand()
{
... base.m_helpFile="MyHelpFile.hlp";
//The Context Help ID as defined when compiling the RTF file into the HelpFile.
base.m_helpID=1234;
...
}
[VB.NET] Public Sub New()
MyBase.New()
...
MyBase.m_helpFile="MyHelpFile.hlp"
'The Context Help ID as defined when compiling the RTF file into the HelpFile.
MyBase.m_helpID=1234
...
End Sub
Upon deployment of the HLP file, you must register its name (for example, MyHelpFile.hlp) as a new string value in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Help or provide the full path name to the m_helpFile property previously described.
Using the custom command and viewing the context-sensitive help
To use the custom command and view the context-sensitive help, perform the following steps:
-
Run an application that loads your custom command and the context-sensitive help command onto a ToolbarControl. The following code example shows how to load these two commands:
//Add the custom command to the ToolbarControl.
axToolbarControl1.AddItem("CSharpMyFullExtent.MyCommand", 0, - 1, true, 0,
esriCommandStyles.esriCommandStyleIconOnly);
//Add the Context Help command (named What's This?) to the ToolbarControl.
axToolbarControl1.AddItem("esriControls.ControlsContextHelpCommand", 0, - 1, false,
0, esriCommandStyles.esriCommandStyleIconOnly);
[VB.NET] 'Add the custom command to the ToolbarControl.
AxToolbarControl1.AddItem("VBDotNETMyFullExtent.MyCommand", 0, -1, True, 0, esriCommandStyles.esriCommandStyleIconOnly)
'Add the Context Help command (named What's This?) to the ToolbarControl.
AxToolbarControl1.AddItem("esriControls.ControlsContextHelpCommand", 0, -1, False, 0, esriCommandStyles.esriCommandStyleIconOnly)
-
Use the What's This tool to click the custom command. The context-sensitive help opens.
See Also:
BaseCommandDevelopment licensing | Deployment licensing |
---|---|
Engine Developer Kit | Engine |
ArcGIS for Desktop Basic | |
ArcGIS for Desktop Standard | |
ArcGIS for Desktop Advanced |