Registering the location of CHM files

Note: This section assumes you are familiar with registering files on a Windows system. If you are not familiar with this process, please talk over the information in this section with someone in your organization who is familiar with the Windows registry.

If a CHM file's location is registered, it is not necessary to give the full path to the file when using the HtmlHelp API to display the file. Once you register a file, you can also create a link to the CHM file provided

  • You display the HTML file containing the link in an HTML Help window, or
  • You have installed KeyFndHH, which will locate the file for you

The following registry location is used:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\HTML Help

The value of the key is the name of the CHM file, and the corresponding data is the folder where the CHM file resides. The following code example shows how to list a CHM file in the registry:

if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
        "Software\\Microsoft\\Windows\\HTML Help", 0,
        "Folder", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS,
        NULL, &hkey, &disposition) == ERROR_SUCCESS) {
    RegSetValueEx(hkey, "your filename", 0, REG_SZ, "your folder",
        strlen("your folder") + 1);
    RegCloseKey(hkey);
}

Use KeyTools to display existing registry entries on your computer. You can also use KeyTools to add, edit, or delete registry entries for testing purposes.