|
|
|
![]() | |
|
|
|
To access the contents, click the chapter and section titles.
Visual Basic 6 Black Book
Creating Help Files With The Microsoft Help WorkshopThe Testing Department is calling again. Your new program, SuperDuperGraphics4U, is really fine, but no one seems to be able to use it. But, you say, its so intuitive and simple: just use Alt+F8 to draw a line, Ctlr+Shift+Esc to draw a circle, and . Add a Help file, they say. You can create Help files with the Microsoft Help Workshop, hcw.exe, which comes with Visual Basic, and appears in Figure 30.6. To see how the Help Workshop works, well create a basic Help file for an application named Helper over the next few topics in this chapter.
To create the Help file, helper.hlp, for the helper application, we will create a Help project, helper.hpj, in the Help Workshop. This project keeps track of the files in our Help system, and in this example, well just have one such file: helper.rtf, which will hold the data for our Help file. In that RTF file, well set up the Help topics to display to the user, along with the hotspots in the Help file that will connect those topics. After adding helper.rtf in the helper.prj file, you can compile that RTF file to create helper.hlp. And to open the helper.hlp Help file, you can use the Windows API function WinHelp as follows:
Private Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd _
As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, ByVal _
dwData As Long) As Long
To create a new Help project, select the New item in the Help Workshops File menu now, select the Help Project item in the New dialog box that opens, and click on OK. Using the Save As menu item in the Help Workshop, save the new Help project as helper.hpj. The new Help project appears in the Help Workshop in Figure 30.7.
Now that weve created a new Help project, well add the actual Help text to that project, and we do that by creating an RTF file, as well see in the next topic. Creating A Help Projects RTF FileThe real work of creating a Help file takes place in the Help files RTF file. This rich text file holds not only the text for your Help files but also holds the commands used in your Help file. For example, you use Help file RTF commands to create Help hotspots, which work like hyperlinks, and pop-up links, which work like tool tips. As well see in the following topics, you use rich text format codes to support these and other Help features. For example, here are some rich text format codes and what they do as far as the Help workshop is concerned:
Well see how these format codes are used in the following topics. In fact, well build our Help files RTF file, helper.rtf, with Microsoft Word, and we wont have to deal with these codes directly. Using Microsoft Word, we create the file helper.rtf now (save the file in RTF format). Next, we add it to our Help project in the Help Workshop by clicking the Files button in the Help Workshop, clicking the Add button in the Topic Files dialog box that appears, selecting helper.rtf, and clicking on OK. This adds helper.rtf to our Help project, as you see in the Help Workshop in Figure 30.8.
In the following topics in this chapter, well see how to create the text in the helper.rtf file to build our Help file. The actual RTF file we create is located in the helper folder on this books accompanying CD-ROM (note that the RTF codes in that listing will not be visible in Microsoft Word, which interprets and formats the text with those codes). Entering Text In A Help FileThe text in a Help file is divided into pages, and only one page is displayed at a time. To divide your text into pages in Microsoft Word, you enter a page break with the Insert[vbar]Break menu item or by pressing Ctrl+Enter. The first page in the RTF file is the first page displayed when your Help file is opened. Lets see an example. Here, we will make the first page of the helper.hlp file were creating a welcome page by entering this text directly into helper.rtf and following it with a page break: Contents Welcome to helper example application. This help file gives you help on the menu items in helper. Now this text will greet the user when the helper.hlp file is first opened, as shown in Figure 30.9.
Actually, this text is not really enough by itselfwe should allow users some way to jump to the Help pages they want to look at, and well do that in the next topic.
|
|
Products | Contact Us | About Us | Privacy | Ad Info | Home
Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. |