How To Add a Font Button to an HTML Help Window Toolbar

Isenção de Responsabilidade para Conteúdo da KB Desativado

Este artigo foi escrito sobre produtos para os quais a Microsoft já não fornece suporte. Por conseguinte, este artigo é oferecido "tal como está" e não será mais atualizado.


It is not possible to add a Font button using the HTML Help Workshop. You must do this by manually editing the HTML Help project file. This article explains how to add a Font button to an HTML Help window toolbar.

More Information

A Window Type is a special configuration that is used to create styles of a Help window. The configuration of Window Type controls which buttons and tabs are used in the compiled HTML Help file. There are options for adding most buttons from the Window Type dialog box. Buttons that cannot be set from the dialog box can be added by editing the Help project file.

The following steps describe how to add a Font button. NOTE: Before doing any of the steps below, make a full backup.

Edit the Project from within the HTML Help Workshop

  1. Open an HTML Help project.
  2. Locate the Add/Modify window definitions icon on the Project tab (it's the third icon down).
  3. Click the icon. The Window Types dialog box opens.
  4. Either open the existing Window Type or add a new one.
  5. Click the Buttons tab.
  6. Select one or more of the check boxes. Be sure that at least one box is selected.
  7. Click the Position tab and click Default Positions.
  8. Click OK.
  9. Save the project.
  10. Exit HTML Help Workshop.

Edit the HTML Help Project File (.hhp)

  1. Open the HTML Help project file using a text editor such as Notepad.
  2. Find the line that starts with the text [WINDOWS].
  3. The Window Type line that you want to modify is below the [WINDOWS] line.
  4. Find the four numbers surrounded by a the left bracket "[" and right bracket "]".
  5. The number to the left of the comma before the left bracket "[" is the value that must be modified.
  6. Change the number to the left to 0x10387E.
  7. Save the changes and exit the text editor.

Finishing the Changes

  1. Go back into the HTML Help Workshop.
  2. Re-open the project.
  3. Open the Window Types dialog box.
  4. Click on the Buttons tab.
  5. Select the check boxes to set the buttons you wish to appear in HTML Help.
  6. Click the Navigation Pane tab and make sure that Window with Navigation Pane, Topic Pane and Button is selected.
  7. Click OK.
  8. Save the project.
  9. Compile the project.

Explanation of the Fix

The number modified in the project file (0x10387E) contains the settings of the check boxes on the Buttons tab in the Window Types dialog box. This is a hexadecimal number (base 16), which is broken-down by HTML Help into a binary number (a number composed of only 1 and 0). Note that binary numbers are read from right to left. Each 1 in the binary number indicates a checked box on the Buttons tab. The 21st digit in this number needs to be set to 1 in order to indicate that the Font button should appear. The HTML Help Workshop does not support the setting of the 21st bit, which is why there is not check box for the Font button.

Hexadecimal Binary
----------- =====================
10387E = 100000011100001111110
^--21st bit
Note that the "0x" in front of the number indicates that the number is a hexadecimal number and is not a decimal number. The actual number is "10387E" not "0x10387E." Below is an example of what the Window Type line looks like after its been modified.

Why was it necessary to click the Default Positions button? The setting of the Default Positions on the Positions tab was done in order to provide a reference point for finding the number to modify in the project file since the positions are surrounded by the bracket "[]" characters.

ID do Artigo: 240062 - Última Revisão: 19 de jun de 2014 - Revisão: 1