Microsoft HTML Help Workshop Tutorial
Microsoft HTML Help Workshop Tutorial
Char James-Tanny Creative Computing Company CharJT@helpstuff.com www.helpstuff.com David Liske, Editor
Prepared for the HTML Help Center
Trademarks
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Char James-Tanny and Creative Computing Company cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.
Table of Contents
SECTION 1: WHAT IS HTML HELP? ..................................... 5
Understanding the New Help Standard..............................................................................................6 Comparing HTML Help to WinHelp ......................................................................................................8 Comparing HTML Help to HTML-Based Help.....................................................................................9
iii
iv
Understanding the New Help Standard Comparing HTML Help to WinHelp Comparing HTML Help to HTML-Based Help
HTML Help is the new Windows Help standard, combining the functionality of WinHelp with the flexibility of Hypertext Markup Language (HTML) and the power of ActiveX controls and scripts.
!
WinHelp refers to Help files developed with Rich Text Format (RTF) files and the Microsoft Windows Help Compiler (HCW). Since 1995, Help developers could choose between WinHelp 3 for Windows 3.x systems and WinHelp 4 for Windows 95/98/NT. HTML is a browser-independent tagging language used to display information on the World Wide Web. It enables you to display text and graphics and use hyperlinks to navigate to other HTML documents. However, HTML doesn't include WinHelp functionality, such as popups, Tables of Contents, Indexes, full text search, and Related Topics.
HTML Help has a slightly different look than WinHelp. Instead of one screen for the navigation tabs (Table of Contents, Index, and Full-text Search) and another screen for the content, HTML Help combines both into one screen, along with a third component, the toolbar. This gives the main window its name (tri-pane).
!
This interface enables users to see where they are within the navigational structure.
HTML Help was first announced in February 1996 by Ralph Walden, formerly Microsoft's lead Help architect, at that year's WinWriter's Online Help Conference. After developers recovered from the shock of a new standard, they realized that there were several benefits in basing Help files on HTML.
!
Help files created with HTML Help are much smaller than their counterparts created in WinHelp and there are virtually no limits (file sizes, number of files, and so on). Developers have full control over both tables and text. Unlike WinHelp, which didn't allow for any kind of table formatting and little text formatting, HTML allows both. Developers wouldn't lose any WinHelp functionality. They can still provide popups, Tables of Contents, Indexes, full-text search, and Related Topics.
Section 1: What is HTML Help?
Copyright 1999-2000 Creative Computing Company
Page 6
Improvements made to HTML can be immediately implemented in HTML Help. For example, HTML was at version 2 when HTML Help was announced. Now, HTML is at version 4, enabling us to take advantage of Cascading Style Sheets, JavaScript, and so on. Using scripts, HTML Help Objects, and ActiveX components, developers can deliver as much or as little functionality as they choose.
In addition, they gained new navigational aids. When developing an HTML Help file, you can specify that the Table of Contents should synchronize with the content displayed on the right when the Contents tab is displayed on the left. This means that users can always track their progress within the topics of the HTML Help file. You can add full-text search (basic and advanced) and a Favorites tab that enables users to bookmark frequently used topics.
!
When an HTML Help file is synchronized, users can display information using any means (the Index, through Full-text Search, or the Favorites tab), and then select the Table of Contents to see where the topic falls within the hierarchy. However, the topic must exist on the Table of Contents for synchronization to work.
Developers can provide context-sensitive Help for applications. Your developers need to use a form of the HTML Help API, which can be found in the HTML Help Workshop Help file.
!
The implementation of context-sensitive Help changes for different development environments. API calls can be encapsulated in a DLL, such as David Liskes HTML Help Object Library DLL. If this is used, your developer doesnt need to worry about the API and can use the properties and methods of the DLL instead.
!
If your developer is using Visual Basic 5 or 6, Davids HTML Help Class Module provides the same interface as the HTML Help Object Library DLL, but with better performance.
One major requirement for HTML Help is that Internet Explorer (version 4 or later) MUST be installed on the user's system. It must also be installed on your system. Neither you nor your users actually have to use IE when surfing the Web. HTML Help files use runtime components from IE to display their content. Also, HTML Help doesn't use any of the 88+ WinHelp macros. If you've developed WinHelp files, you might have used these macros for increased functionality. Although some macros have corresponding ActiveX controls (for example, Related Topics), most do not. You might have to write your own scripts, or have a developer write a DLL or ActiveX control, if there's something special you want to provide for your users.
Page 7
Copyright 1999-2000 Creative Computing Company
Compiled results (.hlp for WinHelp and .chm for HTML Help) Multiple windows (main, secondary, and popups) Table of Contents and Index Full-text search Static graphics (although each type uses different formats) Hotspot graphics and multimedia Hyperlinks Formatting topics (font families, colors, and sizes) Context-sensitive Help Browse sequences (although HTML Help requires more work) Related Topics, Keyword Links, and A-Keyword Links
Differences
! ! ! ! !
Fully functional tables in HTML Help Fully functional fonts (superscript, subscript, and so on) in HTML Help Non-scrolling regions in WinHelp (can be scripted in HTML Help) Macros in WinHelp Scripting in HTML Help
Page 8
Copyright 1999-2000 Creative Computing Company
Cascading Style Sheets Expanding/collapsing Table of Contents Multi-level Index Hyperlinks to URLs, email addresses, newsgroups, or FTP sites Popups Related Topics lists Scripts (JavaScript for both; VBScript for Internet Explorer only) Images and Image Maps Multimedia Forms Context-sensitive Help
Differences
Option Operating systems Compilation Browsers Deploying files Internet access Full-text search Default display format Auto-synchronization in the Table of Contents Information Types Cross-file linking Merging
Section 1: What is HTML Help?
Copyright 1999-2000 Creative Computing Company
HTML Help Windows 32-bit only (95/98/NT) Compiled None Deploy one file Runs locally Yes Yes Yes Yes (although they arent working correctly) Yes Yes
HTML-based Help Any Not compiled All Deploy all files Runs over the Internet Sometimes Browser-dependent No No Yes No
Page 9
Working with HHW What are the Advantages of HHW? What are the Disadvantages of HHW? Converting WinHelp Projects with HHW
Microsoft provides HTML Help Workshop (HHW) for free from their Web site.
!
If you want to download the latest version of HTML Help workshop, go to http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp.
However, it includes only a text-based HTML editor, requiring developers to know HTML when making changes.
! !
You can use any HTML Editor to create your HTML files. These HTML files, commonly called topics, display Help information.
HHW includes full HTML Help functionality, including Table of Contents and Index designers, HTML Help objects through hhctrl.ocx, contextsensitivity, and an HTML Help Image Editor. There are numerous HTML Help authoring tools on the market that make development much easier. Three popular tools are:
!
RoboHELP 2000 for Microsoft's HTML Help by Blue Sky Software Corporation ForeHelp Premier 99 by ForeFront Doc-To-Help by WexTech
! !
Menu options
!
HHW (when an HTML file isn't open) includes the following menu options:
!
File New, Open, Close Project, Close All, Save Project, Compile, Decompile, CHM Information, Preferences View Toolbar, Status Bar, Compiled Help File, HTML Help Messages Test Pop-up Attributes, Keyword Lookup, HtmlHelp API Tools HTML Help Image Editor Help Help Topics, HTML Tag Reference, Version
Page 11
When an HTML file is open, the following menu options are added:
!
File Close File, Save All Files, Save File, Save File As View Set Font, In Browser Window Cascade, Tile Horizontally, Tile Vertically, Arrange Minimized Windows Edit Undo, Cut, Copy, Paste, Select All, Compiler Information, Split File, Find, Find Next, Replace Tags Insert Text Block, Edit Text Block, Character Formatting, HTML Help Control, Heading, Comment, Title
Tabs
!
Once you open a project, three tabs display on the left side of HHW. These tabs contain the Project, Contents, and Index information.
Tool bars
!
The main Toolbar displays when you first open HHW and remains when you open projects or HTML files.
The New icon displays the New dialog box, where you can select to create projects, HTML and text files, Table of Contents, and Index. The Open icon displays the Open dialog box, where you can select to open project and HTML files when no projects are open and HTML files when a project is open. The Compile HTML File icon compiles your project. The View Compiled File icon displays your results. The Display Online Information icon displays the appropriate HTML Help topic in an embedded Help window within HHW.
! ! !
Page 12
Change Project Options Displays a tabbed dialog box with the General, Files, Compiler, and Merge Files settings. Add/Remove Topic Files Displays the Topic Files dialog box. Add/Modify Window Definitions Displays the Add Window dialog box if no windows have been created. Once you've created one or more windows, the Window Types dialog box displays, where you can modify the window settings. HtmlHelp API Information Displays the Map, Alias, and Text Pop-ups tabs, where you can add and remove context-sensitive Help information.
!
While HHW Version 1.22 seems to be more stable, it still has a tendency to crash when removing HTML Help information. Make edits to the API information by opening the project (.hhp) file in Notepad.
View HTML Source Displays the HTML of the selected file. You must select a file from the [FILES] list first. Save Project, Contents, and Index Files Saves these three files with one click. Save All Files and Compile Saves all files before compiling your project.
Page 13
The Table of Contents and Index tabs display different vertical toolbars.
The top icons on each toolbar are the appropriate properties icons (Contents Properties and Index Properties). The last two icons display the source of the selected HTML file and save either the Contents or Index file.
!
This is slightly different from the Save icon on the Project tab, which saves the Project, Contents, and Index files.
Each toolbar contains the Edit Selection, Delete Selection, and positioning arrow icons. The Contents toolbar contains icons to Insert a Heading and Insert a Page. The Index toolbar contains an icon to Insert a Keyword.
!
By default, HHW displays headings as folders when first launched. You can change from folders to books by modifying the Contents options. I'll discuss this in Section 7.
Page 14
Save Saves the current HTML file. Display in Browser Displays the current HTML file in a Help window. HTML Help ActiveX Control Displays the HTML Help wizard. Bold Formats the selected text as bold. Italic Formats the selected text as italic. Underline Formats the selected text as underline. As a rule, Help developers use very little underlining in Help files. Hyperlinks are usually underlined and users could get confused if you use underlining for emphasis.
Page 15
HHW always contains the latest enhancements. It takes time for the tool vendors to implement the changes. HHW is always free. HHW includes an HTML editor. It includes such enhancements as text blocks, character formatting, headings, comments, and topic title dialog boxes. However, it isn't WYSIWYG. HHW includes the HTML Help Control Wizards for ALink Search, Close Window, HHCTRL Version, Index, Keyword Search, Related Topics, Shortcut, Splash Screen, Table of Contents, Training Card, and WinHelp Topic.
!
! !
The HHW Help file includes the HTML Help API information. This enables you and your developers to attach your Help file to an application.
HHW doesn't include a WYSIWYG editor. You need to know HTML to add content to the topic files.
!
This is by design. Microsoft knew that the tool vendors would implement HTML editors, plus there are many tools on the market available for developing HTML. Popular tools include Allaire's HomeSite, Macromedia's DreamWeaver, and Microsofts FrontPage, which works with Robert Chandlers FAR (available at http://www.helpware.net).
HHW doesn't include an automated linking feature (where you select the hotspot text and then select the target topic). You must code links manually.
Page 16
You can convert existing WinHelp projects with HHW. You assign the project (and, therefore, the compiled Help file) name during the conversion. HHW uses the WinHelp project name for the names of the Contents and Index files.
Advantages
! ! ! ! ! !
WinHelp project (.hpj) files to HHW project (.hhp) files WinHelp topics (from the .rtf files) to individual HTML files WinHelp Table of Contents (.cnt) files to HHW Table of Contents (.hhc) files WinHelp Index to HHW Index (.hhk) files WinHelp graphic (.bmp or .wmf) files to HTML graphic (.gif or .jpg) files WinHelp jumps to HTML hyperlinks (but not popups)
Disadvantages
!
The naming convention of the conversion process doesn't adequately identify the topic.
! !
All topic file names are eight characters. The first four characters indicate the document name from the WinHelp project (for example, topics from the Tasks document are prefaced with task). The last four characters are assigned by HHW. The list of file names in the [FILES] section on the Project tab follows the original document order.
! !
Page 17
Authorable buttons (inserted with the {button} command) Browse buttons and browse sequences Default topic setting (HHW assigns the first topic in the first document as the default topic) Multiple spaces (HTML ignores spaces and tabs) Non-scrolling regions Popups Secondary windows WinHelp hypergraphic (.shg) files to HTML image maps WinHelp macros
! ! ! ! ! !
Page 18
Creating a Project File Modifying the Project Settings Customizing the Window Adding a Search Stop List Exercise 1: Creating a Project
2.
Project is selected by default. Click OK and the New Project dialog box
displays.
If you want to convert a WinHelp project, select the checkbox. The next screen that displays enables you to select the WinHelp project and choose where to save the converted results.
3.
If you want to create a new HTML Help project, click Next without selecting the checkbox. The New Project - Destination dialog box displays, as shown on the next page.
Page 20
4. Type the path and file name information in the input box or click the Browse button to select the folder. The Open dialog box displays. Navigate to the desired folder, enter the name of the project, and click Open. 5. When you're finished, click Next. The New Project - Existing Files dialog box displays.
Select the appropriate checkboxes to add existing files to your project. Click Next on each screen that displays after selecting the desired files. If you don't have any files to include in your project, click Next.
6. 7.
The New Project - Finish dialog box displays. Click Finish. HHW creates the initial project information and displays it on the Project tab.
Page 21
New projects include the default project settings. If you want to include full-text search in your results, you must modify the project settings first.
!
If you create the window first, HHW displays a message that the project and window don't match. It's not hard to resolve the problem, since HHW displays dialog boxes where you can just click Next, but it could lead to confusion.
Click Change Project Options and the Options dialog box displays. This dialog box contains four tabs.
Does this
Controls the Title, Default Topic, Default Window, and International Settings. Once you create a window, the Default Window field is updated. You can't specify a default topic until you add topic files to your project. Displays the path and file name of the Compiled File and Log File (if any). Enables you to specify: 1. 2. 3. The Contents file or automatically create it from headings within your topic files The Index file and, if desired, include topic keywords A Full-text Search stop list, so that common words (such as a and the) aren't included in the full-text search. I'll discuss this in more detail later in this section.
Files
Compiler
Enables you to include Notes and/or Progress information while compiling. Allows you to specify the compatibility (which should always be 1.1 or later), to include folder names during compilation, to support enhanced decompilation, to compile full-text search information, and to create a binary Index or Table of Contents. Specifies if other HTML Help files should be merged with this file when creating modular Help.
Merge
Page 22
All compiled HTML Help files use this window to display their content.
The default tri-pane window (with the Search tab) displays as:
! !
The Button Pane has browser navigation icons. The Navigation Pane contains the Contents and Index tabs and, if specified, the Search and Favorites tab. The Contents Pane shows the topic (.htm) files.
! ! !
You can't edit the default window settings. In order to change the window display, you must create a new window.
Page 23
This dialog box only displays the first time you click the icon in a new project. Once one window definition exists, you use the Window Types dialog box (discussed next) to create additional windows.
2. 3.
Type the name for the window in the input box and click OK. The Window Types dialog box displays. Modify the window as desired. When finished, click OK. HHW automatically assigns the window to the project.
Add or remove existing window definitions. Enter the text for the window title bar. Text entered here overrides the title set in the Options dialog box.
Buttons
Set the buttons for the specified window. The default buttons are Hide/Show, Back, Options, and Print. Other choices include Forward, Stop, Refresh, Home, Locate, Jump 1, and Jump 2. For the Jump 1 and Jump 2 buttons to work, you must assign a URL or a topic file. You can add URLs on this tab, or use the File tab to enter a URL or select an existing topic. For the Home button to work, you must enter a URL or select an existing topic on the Files tab.
Position
Set the size and position for the specified window. Click Autosizer to use drag-and-drop to position and resize the window. Click Default Positions to use the default window size and position. Select the checkbox to apply persistence to the window. This allows HHW to remember if users resize and reposition the window.
Page 24
To do this
Select the files or enter the URLs you want to use for the Table of Contents, Index, and Default topic, and for the Home, Jump 1, and Jump 2 buttons. Select the checkbox to create the tri-pane window. Then, enter the settings for the tri-pane window, including the width and properties of the navigation pane. Properties include controlling the navigational pane (whether it displays or not when the user first opens the Help file), if the Help and Contents files should autosynchronize, and if the Help file should toggle the navigational pane on and off when the Help file loses focus. Select the default tab (the one that displays on top the first time the user opens the Help file) and if you want to include the Search and Favorites tabs. If you choose to include a Search tab, click the checkbox if you want your file to use the Advanced Search properties. When you add a window definition before creating any other information, the Default Tab selection is blank. If you choose the Search and/or Favorites tabs, the Default Tab selection includes these choices. The Table of Contents and Index tabs aren't available until you create the files and add them to the Files tab.
Navigation Pane
Select the styles that you want implemented in your tri-pane window. Not all styles are working yet. For example, Right-to-Left Reading Order hasn't been implemented yet. You have to try different combinations. However, the Help file is fine if you don't select any of these options.
Page 25
The full-text search stop list prevents common words, such as the and or, from displaying in the Search results when running the compiled HTML Help file.
!
Including a stop list reduces the size of the full-text search index, which means that the resulting compiled file will also be smaller. The first step is to create the stop list, which is a text file with an STP extension.
! !
You have to use Notepad or another application that allows text files. One of the easiest ways to create it is to use the sample stop words listed in the HHW Help file. Launch the Help file from HHW and use the Search tab to look for the topic named To create a full-text search stop list. Copy the sample stop list and paste it into your file. If desired, add or delete stop words.
The stop file for HHW Version 1.2 has a size limit of 512 bytes. A file created from the stop list in the HTML Help file is 507 bytes. This means that you have to be careful how many words you add or errors will result. After creating the file, add it to your project by using the Files tab in the Options dialog box.
Page 26
Before running the exercises, make sure that you have downloaded the files from the HTML Help Center and copied them to C:\Projects (or another folder of your choice). Create a project file called paint in C:\Projects\Paint. Enable full-text search for the project in the Options dialog box. Create a new window called main. Type Paint Tutorial as the Title Bar Text. Size the window to 800x600, positioned in the upper left corner of the window. Turn on the navigational pane and the Search and Favorites tabs. Copy the stop file from C:\Projects\stoplist.stp to C:\Projects\Paint. Add the stop file to your project on the Files tab in the Options dialog box.
1. 2. 3.
4. 5.
Page 27
Overview of Topics Creating New Topics Adding Topics to a Project Setting the Default Topic Exercise 2: Adding Topic Files
Overview of Topics
! !
Topics are chunks of information in a help file. The following table defines the common topic types that you might use in your Help file:
Description
Description of the main concept(s) of this portion of the help file. May help you make decisions about what other related topics you should consider. How-to instructions for completing a specific task. Usually formatted as a list of instructions. Provides more concrete information than an Overview, but without the how-to information of a Procedure. Description of a specific term or concept. Definition topics are usually accessed through popups, although they can also be lists of terms and definitions, as in a Glossary. Uses multimedia (graphics and/or movies) to show how to accomplish a task or the actual result after the tasks have been completed. Opens when the user requests help while using the application.
Definition
Context-sensitive Help
Page 29
When you create topic files in HHW, they aren't automatically assigned to the project. You must use the Topic Files dialog box to add files to your project.
If an HTML file doesn't specify a Cascading Style Sheet (CSS), the user's browser settings control the formatting. For consistency and control, you should specify a style sheet in your HTML files. Add <LINK rel=StyleSheet href=filename.css> before the </HEAD> tag.
Click Add/Remove Topic Files to display the Topic Files dialog box.
Click Add to display the Open dialog box. The current project folder displays. Select the HTML files that you want to add to your project.
! !
HHW records the path information of all topic files. Before you add the files, you need to copy them to your project folder or to a subfolder of the project.
Section 4: Working with Topics
Copyright 1999-2000 Creative Computing Company
Page 30
The default topic displays as soon as users launch the Help file. This topic can be the first topic from the Table of Contents or it can be an identity topic.
!
An identity topic contains the name and copyright information for the Help file. The only time users see the identity topic is when they first open the Help file.
If you are adding a splash screen to your Help file, you add the control to the default topic.
!
This way, users only see the splash screen when they first open the Help file. I'll discuss splash screens and other HTML Help controls in Section 10.
! !
To set the default topic: 1. Click Change Project Options. The General tab displays by default. 2. Click the drop-down arrow next to Default File. 3. Select the default topic from the list that displays. 4. Click OK.
Page 31
Page 32
Copyright 1999-2000 Creative Computing Company
Setting the Compilation Options Saving and Compiling Viewing the Results Exercise 3: Compiling the Project
Use the Compiler tab in the Options dialog box to control your compilation settings.
Page 34
Copyright 1999-2000 Creative Computing Company
Does this
Notes display whether or not the checkbox is selected. Possible notes include missing topics, errors in Contents and Index files, and broken links in your project. Progress information displays the files in the project as they are processed by the compiler.
Compatibility
By default, compatibility is set as version 1.1 or later. The only other option is 1.0 compatibility. However, you will not be able to incorporate any version 1.1 or later functionality if compatibility is set to 1.0. This includes merging multiple .chm files and binary indexes.
HHW allows you to use subfolders for your different files. When compiling, this setting basically ignores the folder structure and puts all files in the root. If any files in different folders have the same name, you must make all file names unique before using this option.
Select to extract all project information, including the project file, when users decompile your Help file. Select to include full-text search in the compiled Help file. Make sure that the Search tab is selected in the window definition. This option is selected by default. I'll discuss the index in more detail in Section 8. A binary TOC reduces the size of a large Table of Contents, so that it loads quicker. However, other features in the Table of Contents can't be used with a binary TOC.
Page 35
Before compiling, you need to make sure that all files are saved so that the latest information is included in the results.
!
Earlier versions of HHW have been known to have problems. That is, topic files didn't always get saved.
HHW Version 1.22 seems to be having this same problem on different systems. To verify that all files are saved before compiling:
!
Close the topic file. If the file needs to be saved, a prompt displays.
Click the Save icon on the HTML toolbar. Select File | Save. Select File | Save All.
Compiling takes the information in the project file, including all files, and runs them through a piece of software to merge them into one file. The results include all topic files, graphics, and hyperlinks. The compiler also takes the information in the Contents and Index files to produce the Contents and Index tabs. To compile your project:
!
Click Compile HTML File on the main toolbar. The Create a Compiled File dialog box displays. The options include Save All Files Before Compiling and Automatically Display Compiled Help File When Done. Make sure the Save option is selected.
!
In earlier versions of HHW, the Display option didn't always work correctly or consistently.
! !
The compiler creates consecutive log files, which saves notes and progress information. When the dialog box displays, click Save to accept the default file name or select an existing file to overwrite.
Page 36
Copyright 1999-2000 Creative Computing Company
Once you've compiled your file, you can view it to verify the window size and position, topic information, hyperlinks, and so on. If you selected to automatically display the Help file, it should display as soon as the compilation is finished.
!
However, due a bug in Version 1.22, the compiled Help file doesnt always display.
If the file doesn't display as expected, or to view the file at any time, click View Compiled File on the main toolbar. The View Compiled File dialog box displays.
!
The current compiled file name should display in the input box. If it doesn't, click the Browse button to navigate to the project folder and then select it.
Page 37
Creating Hyperlinks
!
With HTML Help, you can choose from the following types of hyperlink destinations:
! ! ! ! !
URL for an intranet or internet website page URL for a topic in the same Help project URL for a topic in a different Help project FTP (File Transfer Protocol) Bookmark (to display content from anywhere in a topic other than the beginning; called a mid-topic jump in WinHelp) Newsgroups Email address
! ! !
Because HHW doesn't include a WYSIWYG editor or automation, you must enter hyperlinks manually or through another HTML Editor. In HTML, a hyperlink requires two parts:
! !
Type <A HREF=target> before the hotspot text. Type </A> after the hotspot text.
Intranet or Internet page: target = http://www.website.ext URL for a topic in the same Help project: target = filename.htm URL for a topic in a different Help project: target = projectfilename.chm::/topicfilename.htm FTP: target = ftp://ftp.website.ext Bookmark: target = filename.htm#bookmark Newsgroups: target = news://news.website.ext Email address: target = mailto:name@website.ext
! ! ! !
Page 39
While HTML Help allows you to use popups, it only allows text-only popups.
!
Text-only popups don't allow any kind of text formatting, such as bold or italic, or graphics.
In order to use text-only popups in HHW, you must use JavaScript and a customized ActiveX control. A basic tutorial, like this one, doesn't usually cover advanced techniques like JavaScript and ActiveX controls. However, once you become familiar with the tool, you might want to add text-only popups. Therefore, the code is provided for future use.
!
Josef Becker (http://www.helpmaster.com) has developed a JavaScript method to create popups. You can get examples and instructions at his site.
<SCRIPT Language=JavaScript> font_info=font_family[,point size[,charset[,plain bold italic underline]]] popup_text_1=popup text for first popup popup_text_2=popup text for second popup </SCRIPT>
!
font_info, popup_text_1, and popup_text_2 are variables for the script. You can change variable names, as long as you are consistent. font_family is the name of the font you want to use. point size is the size of the font. charset is the name of the Character Set for the font. This value can be omitted. plain bold italic underline sets the attribute for the characters. For example:
! ! !
! !
<SCRIPT Language=JavaScript> popfont=Arial,10,,bold popup1=This is my first popup. popup2=This is my second popup on the same page </SCRIPT>
!
Type this code in your topic. Typically, it's entered at the bottom of the file.
Section 6: Creating Hyperlinks
Copyright 1999-2000 Creative Computing Company
Page 40
The next step is to add the code for the popup ActiveX control. ActiveX controls are identified by their classid.
!
You must type the classid exactly as shown or the popup won't work correctly. If you will be creating more than one popup on a page, you only have to enter the ActiveX control code once.
hhctrl identifies this code when you create the hyperlink. You can change this value, if desired, as long as you are consistent. For example:
Type this code in your topic. Typically, it's entered below the script.
Once you enter the script and ActiveX control, you can create the hyperlinks. Scripted hyperlinks are slightly different than the earlier examples.
!
The 9,9, variables control the left and right margins. In this case, they are set to 9 pixels each. The -1,-1 variables control the foreground and background colors of the popup. In this case, they use the default settings, which is black text on a dithered yellow background.
!
It is possible to change the colors. However, I've never been able to figure out what values work consistently.
Page 41
Page 42
Copyright 1999-2000 Creative Computing Company
Adding Contents Information Changing the Contents Settings Exercise 5: Creating a Table of Contents
The Table of Contents is one way users can navigate a Help file. It presents information in a hierarchical format, using headings and pages. You can customize the different levels in your hierarchy by changing the default icons.
!
Headings. By default, headings are shown by folder icons, which you can change to display books instead. They can contain sub-headings and topics and, if you want, can display a topic.
!
This functionality is different from WinHelp, which never allows a book to display a topic. If you choose to use this, you should use it for all books to help prevent user confusion.
Topics. By default, topics are shown by page icons. Displays a (local) topic. URLs. By default, URLs are shown by the Internet icon. Displays the address (URL, email, FTP, newsgroup, multimedia, or remote topic).
When you create a project with HHW, there isn't a Contents (.hhc) file. Therefore, when you click the Contents tab, HHW displays the Table of Contents Not Specified message. If you have a .hhc file that you can associate with the project, click the appropriate radio button and select the file. If you need to create a Contents file for your project, accept the default option by clicking OK. The Save As dialog box displays. The default file name is Table of Contents.hhc. However, you should never use spaces in file names in HHW, so you should change this to projectname.hhc or contents.hhc before clicking Save. The Contents tab information displays in HHW and the toolbar updates accordingly.
Page 44
Adding Headings
!
To create a heading: 1. Click Insert a Heading. The Table of Contents Entry dialog box displays. 2. Type the heading title and click OK. The heading displays at the top of the Contents tab.
To create another heading, click Insert a Heading again. HHW displays a message, asking if you want to insert this heading at the top of the hierarchy. Click Yes or No. You can always reposition books and headings later with the positional arrows.
Adding Pages
!
To create a page to a local topic: 1. Click Insert a Page. When you first insert a page, HHW displays a message, asking if you want to insert this page at the top of the hierarchy. 2. Click Yes or No. The Table of Contents Entry dialog box displays. 3. Type the page title. 4. Click Add. The Path or URL dialog box displays. 5. Select the desired topic from the list of topics and click OK. 6. Click OK.
!
By default, the page is created on the left margin. If you want the page to be an entry under a heading, use the right arrow to indent it under the desired book.
To create a page to another destination: 1. Click Insert a Page. 2. Type the page title. 3. Click Add. The Path or URL dialog box displays. 4. Type desired target in the File or URL input box at the bottom of the dialog box. (See Creating Hyperlinks earlier for targets and formatting.) 5. Click OK twice.
Page 45
To create a heading with an assigned topic: 1. Click Insert a Heading. 2. Type the heading title. 3. Click Add. 4. Select the desired topic and click OK twice.
To assign a topic to an existing heading: 1. Select the heading. 2. Click Edit. 3. Click Add. 4. Select the desired topic and click OK twice.
If you created a custom window, you have to modify the Contents file setting after you create the Contents information. Otherwise, the Contents tab doesn't display. 1. On the Project tab, click Add/Modify Window Definitions. 2. Select the Files tab. 3. Click the drop-down arrow next to TOC and select your contents file (filename.hhc). 4. Select the Navigation Pane tab. 5. Select Auto Sync and change the Default tab to Contents (if desired). 6. Click OK.
Page 46
To change the overall settings of your Table of Contents, click Contents Properties. The Table of Contents Properties dialog box displays.
Does this
Controls the frame and window where the topic displays. You only have to use these fields if you have customized the frameset or want your topics to display in a secondary window. Sets the default font for all entries. Click the Change button to select the desired font family and size. Selected by default, displays headings as folders. Deselect to display headings as books. Select to use your own icons for your Contents entries. However, a bug in HHW requires the absolute path information for the images file, rendering this useless.
Font
Page 47
HHW enables you to also change the default icons for headings (whether originally folders or books) and pages. Select a heading or a page on the Contents tab and click Edit. When the Table of Contents Entry screen displays, select the Advanced tab.
!
The Window and Frame fields are used with custom windows and framesets. You can use the Comment field, if desired.
Mark as a New Entry applies a red starburst to the default icon. Change Entry to a Page displays when a heading is selected. Change Entry to a Heading displays when a page is selected. These options let
! !
Image Index displays auto by default. Click the up and down arrows to
display the other icons that are available for headings and pages. The following table shows the available choices: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
! !
By default, HHW uses icons 5 and 6 for headings and icon 9 for pages.
You can change the icon when you first create headings and pages by clicking the Advanced tab on the Table of Contents Entry dialog box.
Section 7: Designing the Table of Contents
Copyright 1999-2000 Creative Computing Company
Page 48
Heading: Options Menu linked to Options Menu topic Pages: Get Colors, Edit Colors, Save Colors, and Draw
Opaque
2.
Page: Entry Title: Email Char File or URL: mailto:CharJT@helpstuff.com Icon: Email (number 25) Page: Entry Title: Microsoft's HTML Help File or URL:
http://msdn.microsoft.com/workshop/author/htmlhelp/download.asp
3. 4. 5.
Change the Table of Contents to use books instead of folders. Add the Contents file to the window definition. Compile and run your Help file. When you're finished, close your Help file.
Page 49
Adding Index Information Understanding the Differences: Sitemap and Binary Indexes Adding Index Entries to the Index File Adding Keywords to Topic Files Creating See and See Also Keywords Sorting the Index Changing the Index Settings Exercise 6: Creating an Index
! ! ! ! ! !
You can enter keywords in the Index (.hhk) file, in individual topic files, or both. All entries are merged during compilation into the finished index.
! !
A Help file index is comparable to a hardcopy index. A comprehensive index helps the users navigate through your Help file. Duplicate keywords (the same keyword assigned to two or more topics) are displayed once in the index. If the user selects that keyword, the Topics Found dialog box displays, listing all topics containing that keyword.
!
For keywords to display correctly in the Index file, they must be associated with at least one topic.
Add See and See Also keywords to your index (for example, creating, see also adding). When the user clicks this entry, the index displays the adding keyword. By using See and See Also references, you can teach your users the terminology you want them to use. Customize the index. You can place index entries where desired and choose if you want to sort the Index. Create a multi-level index. However, two levels is the norm.
When you create a project with HHW, there isn't an Index (.hhk) file. Therefore, when you click the Index tab, HHW displays the Index Not Specified message. If you have a .hhk file that you can associate with the project, click the appropriate radio button and select the file. If you need to create an Index file for your project, accept the default option by clicking OK. The Save As dialog box displays. The default file name is Index.hhk. The Index tab information displays in HHW and the toolbar updates accordingly. If you only use topic keywords, you don't have to use the Index tab during development at all. I'll discuss topic keywords a little later in this section.
Page 51
By default, HHW creates a binary index for your compiled Help file.
!
A binary index is compiled into your project from keyword entries in the Index (.hhk) file and in the topics. You can't directly edit the binary index. You must use a binary index with associative and keyword linking in your (usually merged) Help system or if you want to be able to merge indexes from different Help files.
! !
The Index (.hhk) file uses the sitemap format, which is an HTML file. The following table shows the differences between the binary and sitemap indexes.
Sitemap Index
Binary Index
Only works with compiled Help files (.chm). Automatically sorted during compilation. Developer cannot control sorting. Compiled size is small, making this a good option for very large indexes. Can be merged with other indexes, which are sorted during compilation. Must be used with associative (ALink) and keyword (KLink) linking.
Works with either compiled Help files or Help projects displayed on a website. (This means a Sitemap Index can be compiled, but doesn't have to be.) Developer has complete control over sorting.
Size is typically larger than a Binary Index. However, due to compression algorithms, this is a better choice for small indexes. Cannot be merged with other indexes. Developer cannot use associative and keyword linking with a Sitemap Index.
Page 52
Copyright 1999-2000 Creative Computing Company
To create a primary (or first level) keyword associated to a local topic: 1. Click Insert a Keyword. The Index Entry dialog box displays. 2. Type the keyword in the Keyword input box. 3. Click Add. The Path or URL dialog box displays. 4. Select the topic from list of files and click OK. 5. Click OK.
To create a secondary (or multi-level) keyword associated to a local topic: 1. Follow steps 1 through 5 above. 2. The keyword displays as highlighted on the Index tab. Use the up and down arrows to position the keyword under its primary keyword, then use the right arrow to indent it.
To create a keyword to another destination: 1. Click Insert a Keyword. 2. Type the keyword in the Keyword input box. 3. Click Add. The Path or URL dialog box displays. 4. Type desired target in the File or URL input box at the bottom of the dialog box. (See Creating Hyperlinks earlier for targets and formatting.) 5. Click OK twice.
To change the keyword title (which displays in the Topics Found list when multiple topics are associated with a keyword): 1. Click Insert a Keyword. 2. Type the keyword in the Keyword input box. 3. Click Add. The Path or URL dialog box displays. 4. Select the keyword destination. 5. Type the desired title in the Title input box. 6. Click OK twice.
!
Page 53
You can add keywords to topics instead of, or in addition to, creating an index file. The following table describes the similarities and differences between keywords stored in topics and keywords stored in the Index file.
Index File
Topic Keywords
Stored within a topic (HTML file). Keyword displays on Index tab only if binary index is created. The HTML Help File must be compiled. Can be merged with other compiled HTML Help files. Cannot be used in See and See Also references. Cannot be custom sorted (automatically alphabetical). Deleting keyword removes it from this topic. Must select checkbox to include topic keywords in project Options. Importing topic with keywords includes all keywords in Index. Can only link to local topics (within the same .chm file). Can be used in Keyword Searches. Cannot be used as a secondary keyword.
Stored within an HHK file (sitemap). Can be used with either binary or sitemap indexes. Can be used with compiled or uncompiled formats (such as WebHelp or JavaHelp). Can be merged with other compiled HTML Help files only if saved in binary format. Can be used in See and See Also references. Can be custom sorted (unless saved in binary format). Deleting keyword removes it from all associated topics. Index file automatically included. Importing topic doesn't include any keywords. Can link to any hyperlink destination. Can be used in Keyword Searches. Can contain up to nine levels of keywords.
Page 54
Copyright 1999-2000 Creative Computing Company
To add topic keywords: 1. Open the HTML file and position your cursor before the </BODY> tag. 2. Select Edit | Compiler Information. 3. On the Keywords tab, click Add. The Add Keyword dialog box displays. 4. Type the keyword and click OK. 5. Add other keywords to this topic, as desired, and click OK.
To include topic keywords in your Help file: 1. On the Project tab, select Change Project Options. 2. Click the Files tab. 3. Under Index File, select Include Keywords from HTML Files. 4. Click OK.
Page 55
One nice feature of HTML Help is the ability to create See and See Also keywords. This allows you to create cross-references (as you would in hardcopy).
! !
See keywords are used for single-entry keywords. See Also keywords are used for multi-level keywords.
See and See Also keywords display in the index, but function differently from regular keywords.
!
When a user clicks the See or See Also entry, the index displays the keyword assigned to that entry.
See and See Also keywords can be entered at any index level (primary or secondary). See and See Also keywords always refer to primary keywords. You have to determine the format you will use to indicate See and See Also keywords.
!
! !
Otherwise, the users won't know they've clicked a See and See Also keyword and can get confused.
Some possible choices are: creating topics: see also adding topics creating topics see also adding topics creating topics (see also adding topics) creating topics, see adding topics
This is a different kind of See or See Also keyword. Primary keywords that are linked to themselves display the following message when selected: To locate information about this keyword,
please select one of the subentries in the list.
This allows you to workaround the hassles associated with primary level keywords, because you don't have to assign one or more topics to the keyword for it to display correctly.
Section 8: Designing an Index
Copyright 1999-2000 Creative Computing Company
Page 56
To create a See or See Also keyword: 1. Click Insert a Keyword. 2. Type the keyword in the Keyword input box. Make sure you include the See or See Also reference so that users understand the keyword functionality. 3. Click Add. The Path or URL dialog box displays. 4. Type the target keyword in the File or URL input box. 5. Click OK. 6. Click the Advanced tab. 7. Select the Target is Another Keyword checkbox. 8. Click OK.
To create a primary keyword that links to itself: 1. Click Insert a Keyword. 2. Type the keyword in the Keyword input box. 3. Click Add. The Path or URL dialog box displays. 4. Type the same keyword in the File or URL input box. This keyword must match the one entered in step 2. 5. Click OK. 6. Click the Advanced tab. 7. Select the Target is Another Keyword checkbox. 8. Click OK.
Page 57
If you aren't using the binary index feature, you can custom sort the Index in your Help project.
!
The binary index feature automatically alphabetizes the Index. Custom sorting isn't possible.
To sort the index, click Sort Keywords Alphabetically. All levels sort into alphabetical order. You can use the positional arrows to move index entries, if desired. However, once you click the Sort icon, all entries are sorted.
Page 58
Copyright 1999-2000 Creative Computing Company
To change the overall settings of your Index, click Index Properties. The Index Properties dialog box displays.
Does this
Controls the frame and window where the topic displays. You only have to use these fields if you have customized the frameset or want your topics to display in a secondary window. Sets the default font for all entries. Click the Change button to select the desired font family and size.
Font
Page 59
2.
Create the following secondary level index entries and associate them with the listed primary keyword and topic:
Keyword Primary Topic
description editing
3. 4. 5.
Create a secondary See Also keyword called Paint under description. Link it to Paint overview. Sort the Index. Compile and run your Help file. When you're finished, close your Help file.
Page 60
Copyright 1999-2000 Creative Computing Company
What Graphic Formats Can Be Included? Inserting Graphics Exercise 7: Inserting Graphics
GIF (Graphic Interchange Format) files are 8-bit graphic files that can display up to 256 colors. They are best used for screen prints and other small images (for example, bullets). You can change the following GIF characteristics:
!
Transparency. You can select one color in a GIF to be transparent, which allows the background color or background graphic of the HTML file to show through. Remember that all areas of that color will be transparent. (If you have a graphic with a lot of white in it, you might want to change any white around the graphic to another color and then make that color transparent).
!
The common background color for transparent graphics is fuchsia (R:255, G:0, B:255, I:13). You can see an example of this by viewing C:\Program Files\HTML Help Workshop\Java\cntimage.gif.
Interlaced. You can display a GIF as interlaced, which displays every other line of the graphic on the screen and then fills in the missing lines. This lets the user see a rough view of the graphic. Or, you can display the GIF as non-interlaced, which displays the graphic line-by-line from the top. Animation. You can display animated GIFs in your topic files. The animation process stores multiple GIFs in one file, which then play in sequence when the user opens the topic containing the file. Remember that less is usually more: animation can be overly distracting in help. (But according to David, its fun!)
JPEG/JPG (Joint Photographic Expert Group) files are 16 or 24-bit graphic files that contain more than 256 colors. They are best used for photographs and other detailed graphics with many colors. You can also use the following graphics in your project for the specific purposes listed.
!
BMP (bitmap) files are used for splash screens, button faces, and custom Contents images. (You can also use GIFs and JPEG/JPGs for splash screens.) ICO (icon) files are used for button faces.
Page 62
Inserting Graphics
! !
To insert graphics in your topics, you use the <IMG> tag. The main attributes of the <IMG> tag are:
! ! ! !
SRC=filename.ext. Include the path information, if necessary. WIDTH=pixels. This should match the width of the graphic. HEIGHT=pixels. This should match the height of the graphic. VSPACE=pixels. This is the number of pixels to display above and below the graphic. HSPACE=pixels. This is the number of pixels to display to the left and right of the graphic. BORDER=pixels. This is the number of pixels for the width of the border. ALIGN=alignment. The possible choices are
! ! ! ! ! ! ! ! !
Default - Uses bottom Left - On the left margin Right - On the right margin Top - Top of graphic with surrounding text Middle - Middle of graphic with surrounding text Bottom - Bottom of graphic with surrounding text Text top - Top of graphic with top of tallest letter on line Abs-middle - Middle of graphic with middle of the line Baseline - Bottom of graphic with baseline (where the capital letters sit) Abs-bottom - Bottom of graphic with bottom of line To center a graphic on a line, use the Center Paragraph option in your HTML Editor. (You can still use any of the other alignment values except Left and Right, which override the centering.)
! !
USEMAP=#mapname. The mapname must match the MAP information included in the HTML file. This information creates an image map, which is a graphic with hotspots.
The <IMG> tag has other attributes. You can find a complete description in the HTML Tag Reference under the Help menu in HHW.
Page 63
Page 64
Why Use the HTML Help Control? Designing HTML Help Control Links and Results Creating a Related Topics Button Creating a Keyword Search Button Creating a Splash Screen Exercise 8: Creating HTML Help Controls
The HTML Help control is stored in hhctrl.ocx, an ActiveX control designed specifically for use with HTML Help files.
!
ALink Search (creates links to AName objects entered in topics; commonly used for dynamic related topics lists) Close Window (closes the current window or browser) HHCTRL Version (displays the current HHCTRL version in an alert box) Index (displays an index sitemap file) Keyword Search (creates links to Keywords entered in topics; commonly used for dynamic related topics lists) Related Topics (displays a list of coded topics) Shortcut (starts a program or opens a dialog box) Splash Screen (displays a splash screen when the compiled Help file first opens) Table of Contents (displays a contents sitemap file) Training Card (specialized Help topics that send instructions to and receive instructions from a program) WinHelp Topic (displays a topic from a WinHelp Help file)
! !
! !
! ! !
! !
! !
HHW includes the HTML Help wizards. These wizards display different dialog boxes, where you can enter the desired information. You must enter the different variables, such as keywords, AName objects, and program names.
Page 66
For all HTML Help controls except for Table of Contents and Index, you can choose how the link displays. For the Related Topics and Keyword Search controls, you can also choose how the output displays.
You can choose how your HTML Help controls display to the user:
!
Hotspot (with scripting) Text button Bitmap or icon (You can use any bitmap or icon). You must add the graphic file to the Baggage folder under the Project tab for the button to display correctly.
! !
You can choose how the results of Related Topics and Keyword Searches display to the user:
!
As a popup
Page 67
If there's a chance that the ALink Search or Keyword Search you're coding won't have any hits, you have two choices. One controls how the link will look to the user. The other controls the results.
! !
Page 68
4.
Select Hidden if you will be scripting this control. Otherwise, accept the default for a button. Select Display on a Pop-up Menu unless you want to display the Topics Found dialog box. Select Display Dialog or Menu Even if Only One Title unless you want one hit to immediately jump to the target topic.
Page 69
5.
Accept the default selection (Display Text on the Button) to display the hotspot as an HTML Help button. If you want to display a bitmap or icon on the button instead of text, select the appropriate radio button. A Browse button displays under the Text field, so that you can navigate to the graphic. Type the button label in the Text field. If you leave this field blank, a mini-button displays (a 12x12 gray pixel button).
Page 70
6.
7.
Add topics to the list by clicking Add. The Add/Edit Related Topic dialog box displays.
8. 9.
Enter the title for the popup menu or Topics Found list in the Title field. Enter the filename (or a URL) in the File/URL field. Continue to add related topics. If necessary, edit or delete entries by clicking the appropriate button. When you've added your list of topics, click Next.
10. The Finish dialog box displays. Click Finish to create your Related Topics hotspot.
Page 71
4. 5. 6. 7. 8.
This dialog box is very similar to the Related Topics dialog box discussed previously. Click the Add button to add keywords to the list.
9.
Click Next.
Unlike clickable ActiveX controls, the Splash Screen control is triggered as soon as the user displays the portion of the topic where the control is located. Because the ActiveX control displays space in the compiled Help file, you should position your cursor after the heading of the topic.
2. 3.
Click HTML Help ActiveX Control. The HTML Help ActiveX Control Commands dialog box displays. Click the drop-down arrow and select Splash Screen from the list. The second field isn't used with the Splash Screen control. Click Next. The Splash dialog box displays.
4.
5. 6. 7. 8.
Type the name of the graphic that you want to display. If necessary, enter path information. Type the number of seconds that the splash screen should display. Click Next. Click Finish.
Page 73
10. Insert a Related Topics HTML Help Control, specifying Menus, Color Box, Status Bar, and Tool Bar as the topics. 11. Compile and test your Help file. When you're finished, close your Help file.
Page 74
Check for broken links and unreferenced topics Verify that your external topic references (URLs, email address, and so on) exist Turn on Full Text Search (in Project Settings), if desired
! !
If necessary, make any corrections, then rerun the reports and make sure everything is fixed.
Page 76
Regardless of anything else, you must send users the .chm file.
If you know positively that your users have installed Internet Explorer 4 (or a later version), you don't have to do anything else. The latest version of IE will always include the latest version of hh.exe. IE itself includes the other files (registered) that are required. (Even if IE is on the system, it's best to run the latest version of hhupd.exe in order to ensure the HTML Help viewer files are up-to-date.)
! ! !
IE4 installs the viewer files for HTML Help 1.0. IE5 installs the viewer files for HTML Help 1.21. Microsoft Win98 SE, Microsoft Windows 2000, Microsoft Office 2000, and Visual Studio 6 all install IE5.
Page 77
If users are installing to earlier versions of IE, or on systems that are only using Netscape Navigator, you must install a minimum of IE3 and then run hhupd.exe. This installs the following files:
!
hhctrl.ocx (C:\Windows\System). This file is required if using custom windows or any ActiveX control. itircl.dll (C:\Windows\System). This file is required when installing compressed files (.chm). itss.dll (C:\Windows\System). This file is required if you are including the full-text search tab. hh.exe (C:\Windows). This file is the run-time engine for the .chm file.
! !
HTML Help 1.3 may also install multiple copies of HHCTRLUI.DLL in 28 folders under the folder MUI.
!
On the HTML Help Installation and Update Package page for HTML Help version 1.22, there are/were 28 language versions of hhupd.exe listed, one for each language. HTML Help 1.3, which ships with both Internet Explorer 5.5 and Windows 2000, is set up for both the multiple language operating system Windows 2000 and the multiple language Office 2000. Because of this, HTML Help 1.3 ships with all 28 language versions. Now, it should only install those language versions you've selected in your system.
!
For example, having three English versions (UK, Australia, and Canada) installed in an Office 2000 installation, you should have three versions of HHCTRLUI.DLL on your machine, one for each of these languages.
You may end up with more if you have Office 2000 on your machine, then install other languages when upgrading this machine to Windows 2000.
Page 78