MSDN Help Integration Guide (integrating HTML Help into the MSDN Library)

Source: Internet
Author: User

Introduced

A long time ago I thought about integrating some of the commonly used HTML Help information (that is, CHM files) into the MSDN Library, but never found a good way. One day I stumbled on Codejoke's website and found it: MSDN integration, isn't that what I've been dreaming of? Really dream to find her 1100 degrees, suddenly looking back on her in the network somewhere ... And, what's even more exciting is that the utility also provides all the source code. I downloaded a crazy study after a while, and found that it is really a good stuff. And he sorted it out to treat the brothers who had the same needs.

Initial Chapter

As you know, the information in the MSDN Library is organized in the form of a "collection (collection)" of HTML Help files. A collection is an XML format file that contains the Help file information used by MSDN. The collection uses two files, one is Msdnxxx.col, and the other is Hhcolreg.dat. The former is an actual collection that contains a list of all the HTML files used by the collection. The name of this file is generally started with "MSDN" and the suffix is ". Col". For example, the June 2000 information collection file is named Msdn020.col. The Hhcolreg.dat file is the registration file for the collection. It stores details about each collection, such as the location of the HTML Help file and the index file and version number title. So we first have to find these two files.

Find Msdnxxx.col files

If you install the MSDN Library, you can use the Regedit utility to find the location of the Msdnxxx.col file in the system registry, with the registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTML Help Collections\Developer Collections

This is where Microsoft stores the HTML Help file collection. The language entry is listed under this key value, which indicates which language the information collection is using. Typical values, such as 0x0409, represent English, and each language is represented by a different value. The next key value is what you want most: which is the current MSDN preferred collection. Typical values such as: 0X0393A0C80, this value varies according to the MSDN installation that is intended to be installed. Below it is filename, which specifies the physical location of the Msdnxxx.col file on the hard disk.

Find Hhcolreg.dat files

The Hhcolreg.dat file, like Msdnxxx.col, is an XML-formatted file that contains specific information about the integration Help files. In the older version of the MSDN Library, this file is placed in the "Windows\Help" directory. Later versions moved the location of the file to the "\documents and Settings\All Users\Application Data\microsoft\html help\" directory. Starting with the 5.0 version of Shell32.dll, we can use the CSIDL_COMMON_APPDATA flag to invoke Getspecialfolderpath (...). API function to get the path to the file's storage. But the later version of IE moved the function to the ShFolder.dll. So we created a version of ourselves to get the file's storage path, which is called Xtafxgetspecialfolderpath (...). We can also use the collectionnum tag in the Msdnxxx.col file to determine the directory where Hhcolreg.dat files are stored. Typically, if this value is less than 10000, the file is stored in the "windows/help" directory.

Edit Collection File

Now that we've found the Hhcolreg.dat and msdnxxx.col two files, we're going to edit the two files to properly integrate the data. First look at the Msdnxxx.col and open the file with a text editor. In the previous lines you will find two tags: masterlangid and collectionnum. These two tags are very important for what we are going to do. Masterlangid tells us what language the collection uses, and Collectionnum indicates which collection is being processed. The typical values for these two tags are:

<masterlangid value=1033/>
   <collectionnum value=10002/>

Each entry in the collection starts with <Folder>, ending with </Folder>. There are three values you need to care about. Two titlestring labels and one LangID label. The value of the first titlestring label is when the MSDN Library is started, and the contents displayed by the directory is selected. The value of the second titlestring is the identifier for the collection, which must be unique in the collection and used in the Hhcolreg.dat file. The value of the label LangID is the value of the Masterlangid.

The following are examples of the first few lines of the typical collection file contents:

<Folder>
  <TitleString value="VC知识库"/>
  <FolderOrder value=2/>
  <Folder>
   <TitleString value="=在线杂志"/>
   <FolderOrder value=1/>
   <LangId value=1033/>
  </Folder>
   </Folder>

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.