SAMPLE: Creating a Glossary Button in Windows Help

Last reviewed: February 15, 1996
Article ID: Q87343
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SUMMARY

HLPGLOSS is a file in the Microsoft Software Library that demonstrates how to add a Glossary button to the button bar in the Microsoft Windows Help application. The help file for the Windows Program Manager is an example of a popular help file that has a Glossary button. When the user chooses the Glossary button, Help displays the Glossary topic in a secondary window.

Download HLPGLOSS.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download HLPGLOSS.EXE (size: 21612 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get HLPGLOSS.EXE (size: 21612 bytes) 
    

MORE INFORMATION

To create a Glossary button, two items must be added to the Help project (.HPJ) file:

  1. In the [CONFIG] section, add the CreateButton macro, which creates the "Glossary" button and programs the button to jump to the topic that contains glossary information.

    The third parameter of the CreateButton macro can contain the JumpContents, JumpContext, or JumpID macro. Specify JumpContents to move to the Contents topic of a Help file. Specify JumpContext to jump to the topic in a Help file with a specific context number. Specify JumpID to jump to the topic in a Help file with a specific context identifier. Any of these macros can move to a topic in the current Help file or to a topic in a different Help file.

    NOTE: If the glossary topic is in a different .HLP file, the [WINDOWS] section in its .HPJ file must define the secondary window. For more information on the CreateButton macro, see pages 309 and 310 of the "Programmer's Reference, Volume 4: Resources" manual distributed with version 3.1 of the Microsoft Windows Software Development Kit (SDK).

  2. In the [WINDOWS] section, add a definition for the secondary window in which glossary information is displayed. This line defines the size, position, and color of the secondary window. For more information on the [WINDOWS] section of the .HPJ file, see pages 64 through 66 of the Windows SDK "Programming Tools" manual.

The following fragment of an .HPJ file demonstrates these two steps:

[CONFIG] ; Because the help topic is in this Help file and the context ; identifier is available, the code below specifies the JumpId (JI) ; macro. The glossary is shown in the secondary "Glossary" window ; specified in the [WINDOWS] section below. The peculiar single quotes ; are significant. Note: In an actual Help project file, the following ; information appears on one line (no break). CreateButton("Glossary_Btn","&Glossary","JI(`hlpgloss.hlp>Gloss', `Glossary_Context')")

[WINDOWS] ; Define the secondary window for the glossary in the [WINDOWS] ; section of the HPJ file for the Help file that contains the glossary ; topic. Gloss = "Glossary",(100,100,350,350),0,(255,255,255),(255,255,255)


Additional reference words: 3.10 3.00 WinHelp softlib HLPGLOSS.EXE
KBCategory: kbtool kbfile
KBSubcategory: TlsHlp


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.