How to Create helpcontextid in HTML Help Workshop and Press F1 in the vbprogram to pop up the corresponding Context

Source: Internet
Author: User

How to Create helpcontextid in HTML Help Workshop, Press F1 in the vbprogram to pop up the corresponding context, the documents in chm format have been written, the tables of context and index file have been written. What should I do next? Please advise. Thank you!

The following part is taken from the csdn forum.

Windows 98's online help system has changed a lot compared with Windows 95. It uses a new help system featuring network super text (HTML), that is, HTML help system. It is the next-generation online help system from Microsoft. It uses basic components of Microsoft Internet Explorer to display help content, it supports HTML, ActiveX, Java, and scripts (Java scripts and Microsoft Visual basicscripts are in the same HTML format (.w.20..gif+.png ). The extension of the HTML Help file is also changed from winhelp. HLP to. CHM. A typical HTML Help System 1 is shown.

  

Figure 1. A typical HTML Help System example

In view of the above reasons, the development of help files that comply with the Windows 98 specifications has become an urgent need for programmers. Microsoft HTML Help Workshop is an integrated development environment provided by Microsoft for this new help system. You can use it to develop help files in a simple, convenient, and fast manner.

1. Create a help topic File

The most important task to create a Help file is to create several theme files that you need. The HTML help topic file is an HTML file created using the super simplified language (html#, and its extension name is .htmor .html.

You can use Microsoft HTML Help Workshop to create a help topic file, but I think it is more convenient to use Microsoft Word 97. Because word 97can Save the worddocument (.doc) file as an HTML file, and even word 97can package a bulk file conversion tool that converts .doc files to HTML files. In this way, you can write a word file based on your writing habits, and then convert it into an HTML file without having to deal with complicated HTML source code. In Word 97, you can also use the Insert menu to define hyperlinks (called body links in HTML Help Workshop) and bookmarks.

2. Create a help project file

2.1 help project file for HTML Help Workshop

The HTML Help Project (. HHP) file is a plain text file that can be opened and edited using any word processing software (such as Windows notepad. The HTML Help project file will create a Help file to link all the elements required. These elements include the help topic file (.html,. htm), the image file (.20.0000.gif0000.png), the index file (. HHK), the content file (. HHC), and other files. It also contains information about how to compile a help project file and help file interface. Finally, HTML Help Workshop compiles all the content into a single help file (. CHM ).

2.2 create a help project file

Go to Microsoft HTML Help Workshop, select new under the File menu, and select project in the new dialog box that appears. HTML Help Workshop starts the new project wizard, follow the Wizard to create a help project file. In step 3, the existing files (an existing file) should be checked in the HTML files box (see figure 2 ), to ensure that the HTML file created using Word 97 can be included in the help project file in step 4.

  

Figure 2.step 3 of the new project wizard

3. Create a directory (content) File

3.1 directories and directory files

The Help file directory is similar to the left half of Windows Resource Manager, as shown in the left half of Window 1. A directory file is a file that contains all the directories of a help file, and each directory contains the entry name (or entry title), shortcuts to the help topic, and attributes of each entry, this file is an HTML file. When you click an entry title on the help file directory page, the HTML file linked to the entry title will be opened.

3.2 Create a directory file

There are two ways to create a directory file:

(1) Open the project file in HTML Help Workshop. On the File menu, click the new option and select table of contents. Workshop creates an untitled directory file and saves it. In the project tab of the project file window, click the "Chang project options (Change project options)" button to open the Options dialog box and enter the files tab (see figure 3 ), in the contents file column, select the saved directory file.

  

Figure 3. Project Options dialog box

(2) If the project file does not contain a directory file, click the contents tab in the created project file window, HTML Help Workshop displays the prompt that the directory file has not been created and allows you to create a new directory file or open an existing directory file, select create a new contents file (create a new directory file) (see figure 4) and click "OK". HTML Help Workshop creates an empty directory file.

  

Figure 4. directory file creation dialog box

3.3 Add a directory to a directory file

On the contents tab, click "insert a heading". The "tables of contents entry" dialog box appears (see figure 5). In the "Entry Title" column of the dialog box, enter the entry title, click the "add" button to add the help topic of the link to the entry.

  

Figure 5. "tables of contents entry" dialog box

Click the "advanced" tab and specify an icon for the entry in the "image Index" column. You can use the book icon for items that contain other entries, and use the question mark icon for other items, as shown in 1.

On the contents tab, click the insert a page button. If you click the insert a page button, the entry you selected does not include other entries and is not included by other entries, then, the HTML Help Workshop asks if you want to create a start entry. Otherwise, click this button to add a subentry.

The other buttons on the contents tab can be used to delete an entry, change the position and level of an entry, and modify the attributes of a directory.

3.4 make the directory file contain another directory file

Open the directory file, select an entry, right-click, and click Insert file in the pop-up menu. In the include file dialog box that appears, select another directory file (. HHC), a statement will appear under the entry you selected: include: filename. HHC, where filename. HHC indicates the name of the directory with path to be included.

4. Create an index)

4.1 keywords (keyword) and index files

Keywords are words, words, or phrases that may be used by users and associated with one or more help topic files. The index file (. HHK) is also an HTML file that contains several keywords. When you click the index page in the compiled help file and select a keyword, the Help file displays the help topic related to this keyword or a list of titles related to the help topic.

4.2 create an index file

The method for creating an index file is the same as that for creating a directory file.

4.3 create keywords

Open the project file and click "insert a keyword" on the Index tab to display the "index entry" dialog box (similar to the "tables of contents entry" dialog box ), on the General tab, enter the keyword name in the keyword column and click "add" to specify the help topic file associated with the keyword.

4.4 set a keyword to jump to another keyword

Open the index file, select the keyword you want to jump to another keyword, click the "Edit selection" button, and click the "advance" tab in the "index entry" dialog box (see figure 6 ), select the "destination is another keyword (destination is a keyword)" box. Click the "General" tab, click the "add" button, enter the keyword you want to jump to in the "file or URL" box, and click "OK ".

  

Figure 6. Advance tab in the Index Entry dialog box

5. enrich the content of the help topic File

5.1 view the source code of an HTML file

There are two methods to view HTML files.

(1) Click Open in the File menu of HTML Help Workshop to open an HTML file.

(2) On the "project" tab of the project file or the "contents" tab, double-click an HTML file or select an HTML file, and then click the "view HTML source" button.

The source code of the HTML file is displayed in the right half of the project file window.

5.2 Insert the HTML Help ActiveX control into the HTML file

5.2.1 introduction to the HTML Help ActiveX Control

The HTML Help ActiveX Control is a type of ActiveX control. It is designed for HTML Help. Insert the HTML Help ActiveX control into the help topic file so that you can add features of help files such as shortcuts, related topics, klinks, and alinks to your help file. The functions and interfaces provided by the HTML Help ActiveX control can be displayed in browsers that support ActiveX technology.

5.2.2 general method for inserting the HTML Help ActiveX Control

(1) open an HTML file in workshop.

(2) Place the cursor in the area where you want the ActiveX control to appear in the HTML file body.

(3) On the "tags" menu, click HTML Help Control to display the hhctrl wizard (see figure 7 ).

  

Figure 7. First and

Step 1: select a command name in the "specify the command (specify command)" column of the dialog box, and enter the Control ID name in the ID name column; step 2: select the display type of the control. The default display type is button. Then, follow the prompts on the screen to insert the HTML Help control into the HTML file. This method is used to insert HTML Help ActiveX controls into HTML files.

5.2.3 insert shortcuts to HTML files)

You can use a shortcut to open or Initialize an executable program in the Help file. For example, you can click a button or link in the Help File (for example, click here in Windows 98 help) to start an executable program, such as Windows notepad) or dialog box (such as the Add/delete program dialog box for Windows ). To insert a shortcut, follow these steps:

(1) In the specify the command bar of step 1 of the hhctrl wizard (see figure 7), select "export cut ".

Parameters.

  

Figure 8. "export cut" dialog box in the hhctrl wizard

5.2.4 insert related topics into HTML files)

A topic is an HTML Help ActiveX control that appears in a topic file that contains links to the topic file related to the topic file. Follow these steps to insert a topic:

(1) in step 1 of the hhctrl wizard (see figure 7), select "related topics" in the "specify the command" column ".

(2) In the "related topics" dialog box of the hhctrl wizard, enter the title and path of the related topic file (see figure 9 ).

  

Figure 9. "related topics" dialog box in the hhctrl wizard

5.2.5 insert a keyword Link (klinks) to the HTML file)

Keyword links (klinks) is created based on the keywords added to the help topic file. When you click the klinks button or link in the Help file, the title of the topic file containing keyword (the same as the keyword in the Klink) is displayed in the list. Klinks is automatically updated when keywords are added or removed in the help topic file. You can also use Klink to jump to the topic file of another help file.

5.2.5.1 create klinks

To create klinks, follow these steps:

(1) Add keywords to HTML files

① Open the HTML file and position the cursor in the place where the keyword needs to be added to the body part.

② Click "compiler information (compilation information)" on the edit menu, start the compiler information dialog box (see figure 10), and click the keywords tab. On the keywords tab, click the "add" button and specify the keywords. Multiple keywords can be specified and separated by semicolons.

  

Figure 10. Compilation information dialog box

(2) Insert a keyword link to an HTML file

To insert a keyword link to an HTML file, you can insert an HTML Help ActiveX Control with the command "keyword search" to the HTML file. The method is described in Section 5.2.1. The steps to insert a keyword link are as follows:

① In step 1 of the hhctrl wizard (see figure 7), select "keyword search" in the "specify the command" column ".

② In the "keyword search" dialog box of the hhctrl wizard, click the "add" button and enter the keywords defined in the compiler information dialog box (see figure 11 ).

  

Figure 11. "keyword search" dialog box in the hhctrl wizard

5.2.5.2 include the klinks keyword in the index file

In the "Files" tab of the "Chang project options" dialog box (see figure 3), select the "include keywords from HTML files (including keywords in HTML files)" box, the klinks keyword will be included in the index file.

5.2.6 insert Association links (alinks) to HTML files)

Associative links is short for alinks. It is created based on alink names that have been added to the help topic file. When you click the alinks button or link in the Help file, the title of the topic file containing the alink name (the same as the alink name in the alink) is displayed in a dialog box or pop-up menu. Different from the keyword, the Help File user cannot see alink name.

The steps for creating alinks are the same as those for creating klinks. The two differences are as follows:

(1) In the compiler information dialog box, click the alink names tab (see figure 10 ).

(2) in step 1 of the hhctrl wizard (see figure 7), select "alink search" in the "specify the command" column ".

5.2.7 use text instead of buttons to display the HTML Help ActiveX Control

After the preceding method is used to add the HTML Help ActiveX Control to the HTML file, HTML Help Workshop also adds an object tag in the HTML file as follows:

1 <Object ID = hhctrl type = "application/X-oleobject"

2 classid = "CLSID: adb880a6-d8ff-11cf-9377-00aa003b7a11"

3 codebase = "hhctrl. ocx # version = 4,72, 7325,0"

4 width = 100

5 Height = 100

6>

7 <Param name = "command" value = "Klink">

8 <Param name = "button" value = "text: klinks">

9 <Param name = "Item1" value = "">

10 <Param name = "item2" value = "Management Department">

11 </Object>

This is a typical label (excluding the row number on the left) added to the hhctrl wizard. The value of "value" in line 7th varies according to the command selected when the HTML Help ActiveX Control is inserted. Line 1 shows that the HTML Help ActiveX Control is displayed as a button by default in the HTML file. To replace the button with text, you only need to change "button" to "text, at this time, the "value" value of Line 1 also changes from the original display on the button to display the HTML Help ActiveX Control as a separate text, which is not underlined, to change the text to an underscore, you only need to add a statement similar to the following between the first row and the second row:

<Param name = "font" value = "verdana, 8, 0x000800, underline"> if you choose not to display text on the button in the hhctrl wizard, then the "value" value of the 8th rows must be changed to the form of "text: XXX.

5.3 insert Javascript into the HTML file (Java Script)

5.3.1 Use a text link instead of a button to display the HTML Help ActiveX Control

Please note that this problem is different from 5.2.7. In 5.2.7, the HTML Help ActiveX Control is displayed in underlined text. In this case, the HTML Help ActiveX Control is displayed through a body link, in fact, JavaScript is added to the HTML file. The implementation method is: Step 2 of the hhctrl wizard when the HTML Help ActiveX Control is created (see figure 7) select "hidden (only used for scripting) [hide (for script only)]". After creating the HTML Help ActiveX Control, add the following tags under the object tag:

<A href = "javascript: hhctrl1. Click ()"> Klink text link </a>

The following is a typical text link label:

<A href = "sd-98-002.html"> A text link </a>

From the comparison of the preceding two tags, we can see that the newly added tag is indeed a text link (called hyperlink in Word 97 ), the difference is that a javascript statement replaces the HTML file to be jumped. The "hhctrl1" added to the tag is the "ID name" of the HTML Help ActiveX Control entered in step 1 of the hhctrl wizard ".

5.3.2 insert a pop-up window (pop-up windows) to the HTML file)

A pop-up window is a pop-up window on the help topic. Its style can be automatically adjusted to fit all the text and images in it. The pop-up window remains above the screen until the user clicks inside or outside of the screen with the mouse. The style 12 of the window is shown below:

  

Figure 12. Example of a pop-up window

To insert a pop-up window to an HTML file, you only need to add statements similar to the following in the HTML file:

<A href =

Javascript: hhctrl. textpopup ("this is how a pop-up window looks.", "verdana, 10", 9,-1,-1)> here </a>

The preceding statement is also a modified body link. The text in parentheses is the text displayed in the pop-up window. You can change it to the text you need according to the format shown in this statement.

5.4 point the link to the topic file in another help file.

You can direct a link to a topic file in another help file by changing the file to the following format: *. chm:/*. htm. The first number * indicates the name of another help file, and the second number * indicates the name of the help topic in the Help file indicated by the first number.

6. Create a search)

The Search tab of the Help file allows you to search for all topic files in the Help file.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.