Visual C++ 6 Unleashed

Visual C++ 6 Unleashed

By MICKEY WILLIAMS and David Bennett

Windows Help Basics

Microsoft has already done most of the work for you when it comes to implementing help for your application. It has taken care of handling the user-interface framework that is presented to the user. You need to add the specific content for your project, and add code to your application to start up the Windows help facility. You will see how to implement your own help later in this chapter, but let's start with the basics of how Windows help works.

There are two different types of online help provided by Windows applications:

Understanding WinHelp

The older, traditional form of Windows help is handled by a separate program named WinHelp.exe, or WinHelp for short. This program presents the standard help dialog to the user, displaying the contents of your help project, as shown in Figure 33.1.

33fig01.gif

Figure 33.1 The WinHelp dialog.

You can quickly tryout this yourself by entering a command line like the following:

WinHelp MyHelp.hlp

By default, the WinHelp dialog provides three tabs, although you may add your own custom tabs if you like. The Contents tab will display the table of contents for your help file, as shown in Figure 33.1.

The Index tab will display a list of the topics contained in your help file, and allows the user to search the list to find the subject she is interested in, as shown in Figure 33.2.

33fig02.jpg

Figure 33.2 The WinHelp Index tab.

In addition, WinHelp allows the user to do a full-text search through the help file by using the Find tab. However, before the user can access the Find tab, the user will see the Find Setup Wizard dialog shown in Figure 33.3.

33fig03.gif

Figure 33.3 The Find Setup Wizard.

This dialog allows the user to specify how WinHelp should create the database file (.FTS) that is used to help perform the full-text search. For large help files, like those used with Developer Studio, building this database can take several minutes.

After the database has been created, the user is presented with the Find tab, as shown in Figure 33.4.

33fig04.jpg

Figure 33.4 The WinHelp Find tab.

This dialog allows the user to search the list of words contained in the help file, or begin typing a keyword or phrase in the top edit box. Whenever a word or phrase is selected, the user will see the list of topics containing that word in the bottom list box. Double-clicking one of these topics or clicking the Display button will bring up the help text for the selected topic.

Most users of Windows applications are familiar with how to use this interface to retrieve the help information that they want. All you have to do is make sure that your help file contains this information and that it is structured to allow easy access.

Understanding HTML Help

HTML Help is similar in many ways to the older WinHelp online help system discussed in the previous section. HTML Help is widely used in Microsoft products—it's used to create the MSDN Library used for online help with Visual C++.

To the end-user, the HTML Help user interface appears similar to the WinHelp user interface. By default, the user interface is divided into two sections. On the left side, navigation tabs enable a user to choose a method to find a particular help topic. By default there are three tabs:

It's also common to add an additional Favorites tab, as found with the MSDN Library.

The Contents tab lists available help topics in a hierarchical view, as shown in Figure 33.5.

33fig05.jpg

Figure 33.5 An example of a basic HTML Help Contents page.

The Index tab, shown in Figure 33.6, lists topics in alphabetical order.

33fig06.jpg

Figure 33.6 An example of a basic HTML Help Index page.

The Search tab, shown in Figure 33.7, lists topic keywords in alphabetical order.

33fig07.jpg

Figure 33.7 An example of a basic HTML Help Search page.

The user interface used by the MSDN Library, shown in Figure 33.8, has been customized to include a drop-down combo box that enables a user to select library subsets for browsing, as well as store a list of topics in the Favorites page.

33fig08.jpg

Figure 33.8 The MSDN Library customizes the HTML Help user interface.

Share ThisShare This

Informit Network