Last Update: Aug 15, 2007
This is a list of Frequently Asked Questions for the FAR HTML program and for HTML Help users in general
See Also: Help Links | HH Tech Info | MS Help 2 FAQ
This section lists Windows Security Updates that have purposely broken MS HTML Help functionality in an effort to fix security holes in Windows. These updates get onto your PC either via the normal Windows Automatic Update mechanism or as part of a Service Pack you may have installed.
Addition notes on HH breakages can be found on our HH Tech Info page.
KB Article KB323180, MS02-055, Other Helpware notes Breakage Shortcuts and WinHelp commands in compiled CHMs now work only on local drives. Work Around No known work around.
KB Article KB810687, MS02-055, Other Helpware notes Breakage: There is a new Group Policy that can restricts the use of shortcuts to certain folders on the local PC. By default MS have not yet enabled this however your system administrator may enable the policy and thus break shortcut commands from CHMs on the local machine. Work Around: MS Security Bulletin MS02-055 says: "The policy sets the HelpQualifiedRootDir key under the System Administrative Template". Normally a search through the registry will not find this key. It is only found if the policy is enabled. Deleting or Renaming this Key will disable the policy. Registry settings work around at KB810687
KB Article KB840315, KB873343, Other Helpware notes Breakage: Only files that have the .chm file name extension can be used as compiled HTML Help files. Programs that use other file name extensions (eg. .ITS) for compiled HTML Help files will no longer display content by using HTML Help. Work Around: Change over to using .CHM extension.
Registry settings work around at KB873343
KB Article MS05-001, KB892675, Other Helpware notes Breakage: ActiveX part of HHCtrl.ocx (main HH engine) now only works on the local machine. This breaks servers and websites that use the TOC and Index controls. Also breaks other commands such as HH Related Topics command and HH Version command. Work Around: Registry settings work around at KB892675
KB Article KB896358, KB896054, MS05-026 Breakage: After installing this update CHM help files work (open) on the local drive. Work Around: Registry settings work around at KB896054 Added 25-Oct-2006: You will find the "UrlAllowList"= command next to useless as although it enables the InfoTech (ITS) protocol to work over the net, it still has no effect on the IE browser which is used to view the CHM pages. 8-Sept-2007: Scrub that comment. I noticed that UrlAllowList= now works again. Obviously Windows Update has delivered a fix to my Vista/IE7 PC. Others are also starting to report the problem fixed.
Added 9-Jun-2007: Lately we have found that MaxAllowedZone=1 seems broken and we need to increase the zone to MaxAllowedZone=3 to make CHMs view correctly on our intranet and file servers. This is due to security changes in Internet Explorer which now (by default) turns off recognition of intranet and file servers.
See blog post KB896054 is broken? for more information.
KB Article KB902225, MS05-026 Breakage: Can't open downloaded CHMs from the web. Work Around: Work around at KB902225 says:
To resolve this problem, click to clear the Always ask before opening this file check box in the Open File-Security Warning dialog box, and then click Open. Alternatively, right-click the file that you want to open, click Properties, and then click Unblock.
KB Article KB896905, MS05-026 Breakage: This breaks our product FAR in 2 places that I know of. In the FAR TOC editor is a test command which displays the current TOC or Index being edited in a HTML Frame set (as uncompressed help using HH ActiveX Visual controls). When you click a TOC or Index item the topic opens in the left frame instead of the right. Work Around: Policy/Registry settings work around at KB896905
See also
Some security updates accidentally break HH. As soon as the problem is discovered a hot fix is released to address the problem.
Date April 3, 2007 KB Article KB935448 Breakage: The Hhctrl.ocx file that is included in security update 928843 (MS07-008), and the User32.dll file that is included in security update 925902 (MS07-017) have conflicting base addresses. This problem occurs if the program loads the Hhctrl.ocx file before it loads the User32.dll file. The KB article indicates the problem is XP SP2 only. Work Around: KB93448 provides a hot fix download.
After the hot fix Hhctrl.ocx version = 5.2.3790.2847
- What's required to Compile HTML Help
- HH compiler error codes
- "HHC6003: The file itircl.dll has not been registered correctly"
- Compilation fails abruptly
- HHW crashes when editing TOC
- Incorrect Project Setup --> Missing content
- Bad Authoring programs install HHA.DLL
- "Warning: Too many topics associated to the "xxx" keyword. Remaining 999 links truncated"
- Cannot write to file "c:\path\file.hhp"
There are a number of reasons why the MS HH compiler may crash.
| 1. | Invalid
filenames
The HTML Help compiler does not like some filenames. Try and stick with these characters _, a..z, A..Z, 0..9. Do not use periods apart from in the normal file extension. Example: A filename such as xxx.h001.gif is identified incorrectly as a HTML file. The compiler then attempts to parse the binary file and crashes. I believe that spaces in a filename can still cause some minor problems with HTML Help. Best to replace spaces with underscores. |
| 2. | Invalid Tags or Characters
Certain sequences of HTML tags and characters can crash the compiler.
|
| 3. | Insufficient Memory
If the help web is big (>10MB) then try recompiling on a more powerful PC (eg. Win2K, 256M RAM, lots of harddisk space on the system drive). If it successfully compiles then you know that free memory is the problem. |
| 4. | File
Paths Too Long From Richard Sloggett (Innovasys): The Microsoft HTML Help 1.x compiler has known problems with the long filenames generated by Document! X .NET documentation. This problem can often (but not always) be worked around by compiling to a root path (e.g. c:\docs). If you need to create CHM format .NET documentation, you can use the 'Generate shortened alias filenames' option on the 'Microsoft .NET Options' page in the Document! X project editor in order to have Document! X shorten the generated filenames. This option does extend the documentation build time though. Rob: So try not to use long file and folder names. Move the project closer to the drive root to reduce the path length. And if you use the Innovasys tool to author, try Richards suggestion above. |
Debugging:
You need to debug your help system. You need to identify the file(s) that are crashing the compiler.
I normally remove sections of my help web by renaming or moving folders and files, then recompile. Keep adding and removing sections until the compiler does not crash. Eventually you will find one or two files that are causing the problem. You may also need to debug these files by temporarily removing sections of the HTML file.
Note: A good starting point is to watch the compile log file being displayed and try to see where the crash appears. Tip: You may need to press PrintScrn (captures the screen to the Windows clipboard) just before the crash to be able to read the list. The compiler normally follows the list of files in the .hhp project file then searches for addition files by examining the .hhc and .hhk files.
This compiler error occurs if you embed the same keyword too many times
throughout your HTML docs. The limit is probably around 256.
Typically seen if all your documents use the same
<title>xxx</title>. This is because the compiler creates K and A
keywords using each HTML document's title text. Say you wanted to
create a .CHM file using say all your daily log files (and they all
had the same title) then you would see this error. I don't think the
error causes any problems. We suggest you use FAR to rename the
titles to $F.$ (filename no ext). This could be automated if
necessary using FAR batch mode.
- What's required to View HTML Help
- HTML Help Versions
- When I click the Index tab Help crashes
- Why does my CHM window show the title "HTML Help " instead of my title?
- Why do my Icons, Images and document style fail to show?
- Why do I see the filename containing %20 in the Favorites page instead of the topic Title?
- Why wont my CHM open?
- Images don't show in the CHM
- Removing "Jump to URL" menu items
- Why do my TOC labels change at Run-time?
- Why do I get a HH_GET_WIN_TYPE Run-time Error?
You should have a minimum of version 1.2 (4.73.8252) installed. Earlier
versions are too unstable. Later versions contain bug fixes and are more stable.
Again note that Windows 2K and ME and later can only be updated using an official
MS Service Pack.
- Why don't I see a HH Version button?
Helpware.net has a page that details all HTML Help releases
http://www.helpware.net/htmlhelp/hh_info.htm
|
It appears that this item (along with the "View Entry" which I don't see anymore under XP) were originally linked to the presence of HTML Help Workshop. The following registry key controlled its visibility. Removing the key would make the "Jump to URL" go away (Thanks Ralph Walden).
HKEY_CURRENT_USER\Software\Microsoft\HtmlHelp Author
Under Windows XP (all versions) the "Jump to URL" menu items are now
linked to the NoRun Group Policy. Set NoRun=1 to hide or disable the menu
items.
http://support.microsoft.com/kb/292504/EN-US/ (Search for "NoRun")
Warning: Enabling the NoRun Policy will remove the "Jump to URL" menu item
AND remove the Run command from the Windows start menu (after a reboot).
The logic works like this...
|
Openkey HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer Read (Dword item) NoRun if item found and (NoRun == 1) hide JumpToUrl |
|
<html> <head><title>Some Title</title> <script> window.location.replace("MyTopic.htm"); </script> </head> <body> </body> </html> |
Note: There are limitations (see section above).
This is a nice site found using Google:
The navigation pane can contain a Contents, Index, Search and Favorites page tab. The Contents tab (AKA Table Of Contents or TOC) is defined by a file with a .hhc file extension. The Index tab is defined by a file with a .hhk file extension. The search and favorites tabs do not require extra files. Your HH authoring tool can create and edit .hhc and .hhk files.
- Open your HHP Editor.
- To remove the Contents and Index tabs:
Clear all edit fields that specify a .hhc or .hhk file. In FAR these fields are on the "Compiler " page and also the "Files" page (if a Window Type is defined).- To remove the Full Text Search tab:
Clear the "Compile FTS information" checkbox. In FAR this is on the "Compiler Page". Also clear the "Show Search Tab" checkbox. In FAR this is on the "TriPane" page (if a Window Type is defined).- To remove the Favorites tab:
Clear the "Show Favorites Tab" checkbox. In FAR this is on the "TriPane" page. If you do not have a "TriPane" page then you may need to define a Window Type. In Workshop this on the "Navigation Pane" page of the Window Types dialog.- If you want to remove the toolbar pane:
Deselect all toolbar buttons and recompile. You will need to create a default window definition if you don't have one.
- Open the FAR HHP Editor window or HH Workshop.
- Define a Window Type if you do not have one ("Window Type" page).
- FAR: Clear the "Remember window position & size" checkbox on the "Window Types" page.
Workshop: Clear "Save window position" ("Position" page tab in the "Window Types" dialog)
This stops the window remembering if the navigation pane was open or not.- FAR: Check the box labeled "Initially closed" in the "TriPane" page
Workshop: Check the box labeled "Open with navigation pane closed" in the "Navigation" page.
q HH.EXE is distributed with HTML Help so you can rely on it being present. It lives in the Windows folder and has a limited number of command-line options. HH.EXE is associated with .CHM files. So double-click a .CHM file and Windows will open the file using HH.EXE. It is a very small file, it mostly passes the help filename onto a HH API library. HH.EXE is not single instance, if you open a CHM file three times using HH.EXE, then three help windows will appear.
Example of opening a help topic using Help ID = 1001HH.EXE -mapid 1001 ms-its:path/help.chm
Note: The “–map <ID> <file.chm>” command line became available in HH 1.1b.
Example of opening a help topic using a topic path
HH.EXE ms-its::path/help.chm::/path/topic.htm
HH.EXE mk:@MSITStore:path/help.chm::/path/topic.htmExample of using HH.EXE to decompile a CHM help file
HH.EXE -decompile destdir file.chm
where "destdir" is the directory to put the files into. This could be simply "."Note: The mk:@MSITStore protocol works with IE3 and above while ms-its works with IE4 and above. A shorter version of “ms-its” is to just use “its”. Actually, the later versions of HH don’t even require the protocol prefix.
q KeyHH.EXE is a free program from KeyWorks Software, written by Ralph Walden. KeyHH.EXE supports many more command line options then HH.EXE. I have to say that KeyHH.EXE is an excellent program. I distribute it with most applications I help produce.
You can get more information about KeyHH.EXE from the KeyWorks web site at http://www.keyworks.net/.
Problem:
"Help cannot find a system component"
Every application has a Current Directory setting. DLLs like the HH 1.x API do not. Their Current Directory is the host applications Current Directory. When we launch help via Explorer, the host is HH.EXE -- a small launch program that Windows has associated with .CHM files. Open a .CHM using Explorer or Windows Shell, and HH.EXE calls the API to launch the .CHM file.
HH.EXE politely sets its "Current Directory" to be the .CHM folder. This is good, because imagine we have other .CHM help files, programs, documents etc. in the same folder. In a merged help system, or when a CHM topic uses a HH Shortcut command, it is important that the Current Directory is set correctly, otherwise these other help components will not be found.
Problems arise however, when "our" applications open help (using the Help API). The application will often change the Current Directory when a user performs File > Open, or File > Save As etc. Or maybe the .CHM help file(s) are stored below the Application Folder in a .\Help folder. The user presses F1, we launch the main .CHM help file, however we have an incorrect Current Directory, and Merging and shortcuts all fail.
Fix #1:
The best fix that I have found is this: In your application code, just prior to performing a Help API call (to open help). Set the Current Directory to the Help directory (your developer knows how to do this). If required, you can reset the Current Directory back to its original setting after the API call.
Another fix that some folk use is to make sure the help components are installed to folders in the Windows search path. From memory, this helps with HH Shortcuts only. For Example we have a video viewer we launch via HH Shortcut. We install the Video Viewer into the Windows directory where it can always be found.
This Current Directory bug is probably the main reason why the next generation of help (MS Help 2.x), now uses the Namespace system instead of the file system.
Words From Wizard Ralph Walden (x-MS):
To help windows locate a help file, place the name of the help file in a special registry key or ini file.
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\HTML Help]
Name = myfile.chm
Data = "c:\chmfolder\"Or use HH.INI. You do not need to reboot a Win95 machine for the registry to work. The primary advantage of the hh.ini file is that you can add a prompt to tell the user something should the file not be found. That's particularly useful if the CHM file is on a CD-ROM and you need to tell the user to insert a specific CDROM disk. The format is identical to the WinHelp.ini file. The following docs are taken from the hcw.hlp file and modified for HTML Help:
[FILES]
HLP-filename=path, messageExample: The following entry instructs Help to look in the \Product\Files folder on drive P for the Notepad Help file. If necessary, Help will prompt the user to insert a CD into the drive:
[FILES]
Notepad.chm=P:\Product\Files, Please insert your Windows 98 CD into drive P.
Shortcut Fix: #2 From Mr Wizard "Rainer H. Rauschenberg" <rainerh AT wiwi.uni-frankfurt.de>
Rainer builds the full path to the external file using some cleaver script. Thanks Rainer:
<SCRIPT LANGUAGE="JavaScript">
document.write('<OBJECT id=myid type="application/x-oleobject"');
document.write(' classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"');
document.write(' codebase="hhctrl.ocx#Version=4,72,8252,0"');
document.write(' width=100');
document.write(' height=100');
document.write('>');
document.write(' <PARAM name="Command" value="ShortCut">');
document.write(' <PARAM name="Button" value="Text:Test">');
document.write(' <PARAM name="Item1" value=",');
document.write(location.href.replace(/mk:@MSITStore:/,"").replace(/\\[^\\]+\.chm::.*$/,""));
document.write('\\otherhelpfile.chm,">');
document.write('</OBJECT>');
</SCRIPT>Rainer: "only drawback I found is that ',' are not allowed in the path"
Updated examples from Rainer (German site)Rob Chandler: Script Update -- I found that my IE6 topic location.href file paths inside a CHM can now be prefixed with either mk:@MSITStore or ms-its or its: (before was only mk:@MSITStore).
See below Script_to_External_File
Problem:
When I upgraded WinXP SP1 (or IE6 SP1) my HH Popups were all truncated to 256 characters.
Discussion:
HH 1.4 (WinXP SP1, IE6 SP1) introduced a new bug where HH Popup text is truncated to 256 chars. MS know about the bug and will try and fix it in a future release.
Popup alternatives: Download Simon's great popup examples (HelpTips.zip):
http://www.simon-jones.org.uk/help.htm
Or use the free ActiveX Rich HTML popup from www.keyworks.net (see KeyHelp popup demo below).Bug Fixed:
This bug was fixed in the Critical Update released on February 2, 2003.
To download the update, users can go to:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;811630
With this update, popups are now limited to 4096 bytes.
Normally when you perform a search, the results list is a bunch of items with titles lifted from each documents <title> tag. But if you have enabled Binary TOC you may see Titles that do not seem to correspond with the associated Topics. What happens is for a Binary TOC the topic title is lifted from a TOC item label instead of the documents <title> tag. I suspect that this is a HH 1.x Collections feature.
Problem:
A few Windows 2000 users have recently reported that the links in their HTML Help files stopped working after they installed Windows 2000 Service Pack 4. Installing the latest critical update did not fix the problem.
Solution:
Apparently with SP4 IE overwrote the hhctrl.ocx CLSID with the wrong registry key. The fix is to unregister then register hhctrl.ocx (the unregister must be done first).
regsvr32 /u <drive>:/winnt/system32/hhctrl.ocx regsvr32 <drive>:/winnt/system32/hhctrl.ocxWhen this problem occurs on platforms other than Windows 2000 SP4, the solution is to install Critical Update 811630. http://support.microsoft.com/?kbid=811630
Problem:
After downloading the latest Internet Explorer I now get popups showing for HTML that contains embedded (ActiveX & Java) content.
Solution:
This is because some idiot has selfishly rolled MS for half a Billion US$ over a very old patent on embedding remote content. The end result is MS IE must now show a popup message when embedding remote content in HTML.
The solution at the moment is to put offending <object> and <applet> statements in a separate JS include file and use document.wrtite() statements. Local ActiveX is not a problem.
MS have produced a test IE6 application you can download to a local folder (it will not disturb your normal IE installation) . Once installed try opening a web page with embedded content.
MS have published fix up notes here
Other reading
- http://www.macromedia.com/devnet/activecontent/articles/devletter.html
- http://www.macromedia.com/devnet/activecontent/
- http://developer.apple.com/internet/ieembedfix.html
- http://swpat.ffii.org/patents/effects/eolas/index.en.html
Problem:
I have a number of CHMs all with the same filename (but different folders). When my application switches between these CHMs the original CHM is always displayed, even though the absolute path to each CHM is used.
Solution:
The HH API has an annoying ability to remember a CHM by its filename only (no directory). Thus when an application opens c:\test1\Help.CHM then closes that and opens c:\test2\Help.CHM the result is that the Test1 file is displayed both times.
One fix is to close your application between each CHM opening. The easiest fix is to call FreeLibrary() then LoadLibrary() on the HHCtrl.OCX Library before opening each CHM.
This second solution only works if your application dynamically loads the HH API (HHCtrl.OCX) using LoadLibrary. Applications written in languages such as VB which statically load the API wont be able to do this.
Multi-page print breaks for images not wrapped in double-quotes
Reported by: Greg Walker, 20-Feb-2004, HH Version 5.2.3644.0
Verified by: Rob Chandler, HH version 5.2.3735.0.Nov 2004 - RWC: Sounds like the bug introduced in HH 1.4 (5.2.3644.0) this bug was fixed shortly after in HH 1.4a (5.2.3669.0) -- See HH 1.4
From Greg:
HTMLHelp is not translating img tags when preparing a multi-page print temp file (right-click on a topic in TOC and select Print:All subtopics) UNLESS the src is encased in double-quotes. HTML standard accepts double-, single-, or no quotes at all.
Sample html in original:
<img src=img/thing1.gif ...>
<img src='img/thing2.gif' ...>
<img src="img/thing3.gif" ..>
Viewed in CHM all three images are displayed. Print a single page, all images print. Print from topic, and this is what is generated:
<img src=mk:@MSITStore:C:\Program Files\blah\PrintBug.chm::/img/thing1.gif ...>
<img src=mk:@MSITStore:C:\Program Files\blah\PrintBug.chm::/'img/thing2.gif' ...>
<img src="mk:@MSITStore:C:\Program Files\blah\PrintBug.chm::/img/thing3.gif" ...>
Note the CHM is stored in a directory path containing spaces.Thing1.gif does not print because there is a space in the path (Program~Files). Thing2.gif does not print because the single-quotes are in the wrong place. Only thing3.gif is printed.
This happens with the latest HH.exe (5.2.3644.0). Workaround is to ALWAYS use double-quotes.From Manny:
I found a different problem. I was using double quotes for all my images but still did not get some pictures to print. I was able to discover the problem. HTML Help requires the <img tag and the src= attribute to be on the same line! If they are not on the same line then HTM Help will not recognize that it needs to put the special mk:@MSITStore tag in front of the src= attribute.
From obab: 11/11/2006
** The Multipage issue: **:
I had the border attribute first:
<IMG border="0" SRC="images\pagedirector.jpg" ></IMG>
I put SRC first (and then removed the quotes off border as I saw an example
without the quotes).
<IMG SRC="images\pagedirector.jpg" border=0></IMG>
this works now
** The stylesheet issue: **
I originally copied this line from the HHW help and just changed its values:
<LINK REL = "stylesheet" TYPE = "text/css" HREF = "css\Style.css">
On multipage print it threw errors until I notices spaces on each side of
the "=" sign. Once I removed the spaces it all worked fine.
<LINK REL="stylesheet" TYPE="text/css" HREF="css\Style.css">
How to link from a Topic inside a CHM help file, to a file outside the CHM:
- http://www.cybertext.com.au/tips_HTML_chm_external.htm
- http://msdn2.microsoft.com/en-us/library/ms644690.aspx
See also
Some applications/controls/technologies cannot read files embedded inside a CHM file. To run an Applet in a HTML Help window you must leave the applet files outside the CHM. Similarly if you embed Windows Media Player control in a HH window, the media files (.MID, .WAV etc) must be left outside the CHM (Media can be read by DOM but apparently not an embedded media control).
How's it done? Download Examples (if you don't have Java installed then only Example 3 will work)
Note: The script has been update -- See below Script_to_External_FileNote: Embedded Videos can be run from a CHM page. Here's a tip from Wizard Alexander Halser:
Automatically start AVI video when the topic opens:
<img start="FILEOPEN" loop="1" DYNSRC="movefile_test.avi">
An MPEG video with sound that starts playing when you move the mouse over
it (appropriate decoder must be installed, of course):
<img start="MOUSEOVER" loop="1" DYNSRC="dragdrop_videosample.mpg">Macromedia Director and Shockwave Flash Viewer:
Director files need to also go outside the CHM as well. Shockwave Flash on the other hand embeds nicely. Although please note that Flash player 6.0 (original release) broke embedding in CHMs for a little while until they fixed the problem in the 6.0.40.0 release (also know as 6.0 revision 40). Note also that multiple SWF files (normal Flash with no XML) that load each other work OK.
Camtasia
2/10/2004 - TechSmith Camtasia Flash files do not work inside a CHM file. Probably because the XML support file can not be found while inside a CHM file.
I found if I left the Camtasia HTML, XML, SWF outside the CHM and dynamically created a path to this external HTML (see download example above) then I could in fact make the Camtasia Flash run inside the HH window (or use Target="_blank" and make it open in a separate IE window).
<SCRIPT Language="JScript">
var path = GetCurrDir(); //See script in download link above
if (path != '')
path = path + '\\';document.writeln(' <p><a href="' +path+ 'Camtasia\\Flash_noscript.html">
Open Camtasia file in HH window (External HTML)</a> ')
document.writeln(' <p><a href="' +path+ 'Camtasia\\Flash_noscript.html" target="_blank">
Open Camtasia file in new Explorer window (External HTML in new window)</a> ')
</SCRIPT>
Script to External File ( Updated 4-Mar-2005)
Here is my script for linking to a file outside in the CHM folder.
This script dynamically creates the HH Shortcut code with full paths to the external file and any param.Try not to rely on relative paths and the Current Directory being always set correctly. Far better to use code like this that dynamically creates the full path to the external file on the fly.
// Return current dir -- // returns "" if in a browser // returns full path to CHM folder if in a CHM (with trailing \\) // If in browser then - location.href=file:///d:/path/file.htm // If in CHM then - location.href=mk:@MSITStore:D:\path\help.chm::/file.htm function GetChmDir() { var X, Y, sl, a, ra, dir; ra = /::/; a = location.href.search(ra); if (a <= 0) //not a CHM - return an empty string return(""); //find the index of the first colon in the string X = 0; ra = /:/; a = location.href.search(ra); if (a == 2) X = 14; //prefix = mk:@MSITStore: else if (a > 2) X = a+1; //prefix = ms-its: OR prefix = its: //find last back slash sl = "\\"; Y = location.href.lastIndexOf(sl); dir = location.href.substring(X, Y); //UnEscape path - EG. Replace %20 with spaces - Return path with trailing \ var dir2 = unescape(dir) return(dir2 + "\\"); } //Define a HH Shortcut with full path to exe and param if passed function DefineHHShortcut(SCID, ProgName, Params) { var AppPath = GetChmDir(); ProgName = AppPath + ProgName; if (Params != "") Params = AppPath + Params; document.write('<object id="' +SCID+ '" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width="14" height="14">'); document.write('<param name="Command" value="ShortCut">'); document.write('<param name="Item1" value=",' + ProgName + ',' + Params + '">'); document.write('<param name="Window" value="">'); document.write('</object>'); }//Create a Shortcut DefineHHShortcut("hhctrl, "MyProg.exe", "");
With Internet Explorer 5.5 you can no longer link to ZIP, PDF, etc files embedded inside the CHM file. Some file types may be ok. The bug appears to be a side effect of a security fix released with IE5.5.
The fix is to install 5.5 SP2 or leave the files outside the CHM as shown in the example above.
See MS document Q245572
Many authors compile binaries (PDF, ZIP, DOC files) into CHMs and use standard HTML code to link to the file. E.G. <a href="myfile.pdf">View PDF</a>
Problem:
If the PDF viewer (Acrobat Reader) embeds into the HH window instead of opening in a separate window, you will see a blank topic window. This is an Adobe bug (says MS).
I have not tested this with latter version of Acrobat Reader. Please let me know if you have success.
Solution:
- You can turn off embedding from within Adobe Acrobat Reader Version 4 and 5. Start Adobe Acrobat Reader and go to File | Preferences | General (Ctrl-K). Then, unselect "Web Browser Integration".
- Leave the PDF file outside the CHM and use the HTML Help shortcut command to open the PDF (the executable name is the PDF filename). This command only works inside a CHM.
<OBJECT id=hhctrl type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=100 height=100>
<PARAM name="Command" value="ShortCut">
<PARAM name="Button" value="Text:Open PDF">
<PARAM name="Item1" value=",Test.pdf,">
</OBJECT>
Embedded Links Not Working?
If your embedded file links don't work at all then please see bug Q245572 above.
Here is an undocumented method of adding Keyword mark-up using Meta Tags (instead of ActiveX mark-up). That is, adding ALink and KLink info to topics, for the compiler to collect at compile time. KLinks are visible (as usual) and displayed in the Index tab with the other .HHK file items. This method is used with MSDN documents.
Examples from MSDN (view source to see more):
<META NAME="MS-HKWD" CONTENT="Usage Peak counter">
For multi-level us a comma...
<META NAME="MS-HKWD" CONTENT="Page Faults, Job Object Details">
I found if you define a Keyword "xxx,yyy" then you must also define a keyword "xxx" somewhere as well, or the result could be a little strange.
A-keywords are defined similarly, but the name is "MS-HAID".
Note: The advantage here is this Keyword mark is NOT removed from the HTML document at compile time.
"Rhonda Bracey" (www.CyberText.com.au) has some great tips on creating PDFs from CHM files:
http://www.cybertext.com.au/tips_HTML_pdf_from_chm.htm
Documentation Wizards Peter Lees and Adrian Green have post the following tips on creating PDFs from CHMs:
From "Pete Lees" <...>
Subject: CHM to PDF
Date: April 2001Here's a quick workaround that may work for you. (To give credit where it's due, I think Rob Cavicchio suggested this originally.)
=================
You can get a combined HTML file that contains all of the text in a
particular contents book as follows.
- Right-click the book and choose "Print".
- Choose "Print the selected heading and all subtopics".
- When the print prompt appears, ALT+TAB to Windows Explorer.
- Browse to your TEMP folder, and find the latest file of the pattern "~hh*.htm". This is a concatenation of all the HTML files in the book you printed.
- Copy this file elsewhere before cancelling (or continuing) the print job, as the file will then be deleted. If you have Acrobat installed, you can continue the print job to PDFWriter or Distiller to create a .PDF from these topics.
=================
To add to this: if you add a book heading at the beginning of the TOC and make all the following headings and pages subentries of it, you can use the above method to create an HTML file containing *all* the topics that have an entry in the TOC.
"Pete Lees"
From: "Adrian Green" <...>
Subject: CHM to PDF
Date: Tue, 22 May 2001 11:51:32 +1000
The method I've been using is:
Install a Postscript driver that redirects its PS output to a file.
eg: "HP LaserJet 5P/5MP Postscript"Print the complete CHM. The PS driver will prompt for a PS file to save to.
Then use the freely available "Ghostscript" & viewer software to convert the resulting postscript to PDF.
(incidentally I find Ghostscript's pdf reader to be a quicker & smaller alternative to Acrobat reader)Just thought I'd mention this - useful for people who do not wish to spend $$$ on Acrobat distiller. The above process is quick, free and has great results. The only drawback is loss of navigational links in the output.
Regards,
Adrian Green.
Problem #1:
When the TOC contains more than one occurrence of a filename, the auto-sync feature often jumps to the wrong item in the TOC. This happens even if the files (with the same name), live in different CHMs.
Fix: #1
Firstly, try and limit the use of duplicate file names. Don't use the same name (eg. "Index.htm") in every folder. A prefix is a good idea. Example: Prefixing all files in the Reference CHM with "Ref_" will minimize problems between merged CHMs.
But sometimes we do need to link to a single file from several places in the TOC.
The following solution comes from wizard Rick Stone (eHelp MVP):
Link to a dummy redirection file. This dummy file has a unique filename, no visible text and simply redirects the user to the correct topic. The redirection is not seen by the HH auto-sync. Change all links, including URLs in your TOC, to point to the dummy file.Example of a redirection file. The <title> tag is optional.
<html>
<head>
<title>Same title as main.htm</title>
<meta HTTP-EQUIV=refresh CONTENT="0;URL=main.htm">
</head>
<body></body>
</html>Tip: Try and use helpful filenames. Example: pxy_ref_main.htm
The "ref_" prefix tells me the proxy is used by the Reference CHM. The "pxy_" prefix says it is a dummy proxy file.Fix: #1 Take 2 - Here "Gabor Hojtsy" has taken Ricks solution and refined it:
Instead of creating many redirection files, just create one (_redirect.html) and pass it the file to redirect to in a bookmark. Here is _redirect.html...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Redirect Page</title>
<script>window.location.replace(window.location.hash.substring(1));</script>
</head>
<body></body>
</html>Links are in the form:
_redirect.html#page_to_jump.html
_redirect.html#other_page_to_jump.html
By using replace() in the JS code above, the redirect page won't be there in the history list, it won't clutter the back button list with useless pages. The JScript requires a minimum of IE4.[Top marks Gabor]
Many thanks Alexander Halser who reports that TOC Auto-Sync fails on the TOC Node that points to the Default Page, if the Node is non-binary and the first node in the TOC.
I have verified this is a bug, testing under Window XP SP1. Alex was able to duplicate this behaviour with different versions of HTML Help and MSIE on Windows 95, 98, 2000 and XP.
Description:
If you click a link that takes you to the CHM's default page, then TOC Auto-Sync will fail.
IE. TOC auto-selection will not change to the Node that points to the default page.
This occurs under the follow conditions:
- The TOC is compiled non-binary.
- The Default topic is the very first node in the TOC.
Workaround:
- Use binary TOC.
- Make the Default topic something other than first node in the TOC.
Problem:
HH allows you to customize the TOC icons by providing a strip of images in a BMP file. Unfortunately this feature was never fully completed and only works if you specify an absolute path to the BMP file.
Fix: #1
Ralph Walden: "If the graphic is on the same drive as the project file, the path is forced into a path relative to the project file -- unless it is prefixed with a file: protocol. That of course breaks your custom icons. The only workaround I can think of that is to prefix the path with file:\\ to prevent the compiler from converting the full path into a broken relative path, or to make certain that your project file is on a different drive then the BMP file."
MVP Rick Stone: "When you specify the icon strip file, ensure that it says c:stripname.bmp and not just simply do stripname.bmp. (note the absence of the typical backslash after c. This should work regardless of the folder the .CHM and strip are copied to, but it limits the placement of the .CHM on the C drive in order to use the custom strips. If the .CHM and the icon strip file are moved to E: for instance, it won't work."
<OBJECT type="text/site properties">
<param name="ImageList" value="file://c:wwhelpicons.bmp">
<param name="Image Width" value="16">
<param name="Color Mask" value="0xff00ff">
</OBJECT>Fix: #2
Rick Strahl's solution: Install the BMP to the windows folder (EG: c:\windows or c:\winnt) then use %systemroot% in the BMP path. Tip: Type "ECHO %systemroot%" at a DOS prompt.
<OBJECT type="text/site properties">
<param name="ImageList" value="file://%systemroot%\wwhelpicons.bmp">
<param name="Image Width" value="16">
<param name="Color Mask" value="0xff00ff">
</OBJECT>%ProgramFiles% could also be used. This environment variable contains the Program Files directory path.
Example: "c:\Program Files".
Question:
How do I open a control panel applet from HTML Help?
Answer:
Use the HH Shortcut command to run rundll32.exe. This windows file is in the windows search path so no directory info is required. You specify the CPL applet and page tab to open via command line parameters.
Parameters: shell32.dll,Control_RunDLL CPLfilename,@AppletNo,AppletPage
CPLfilename = name of CLP file - eg. "XXX.CPL" - Leave blank to show the control panel.
AppletNo = Specify which applet to run (zero based).
E.G. MAIN.CPL,@0 is mouse properties, while MAIN.CPL,@1 is keyboard properties.
AppletPage = CPL Applet page to display (zero based). Not always in a logical order.
The following reference was creating by observing my Windows 98SE system.
CPL filename Applet No Description APPWIZ.CPL 0 Add/Remove Programs Properties DESK.CPL 0 Display Properties INETCPL.CPL 0 Internet Properties INTL.CPL 0 Regional Settings Properties JOY.CPL 0 Games Controllers MAIN.CPL 0 Mouse Properties MAIN.CPL 1 Keyboard Properties MAIN.CPL 2 Printers Window MAIN.CPL 3 Fonts Window MMSYS.CPL 0 Multimedia Properties MMSYS.CPL 1 Sound Properties MODEM.CPL 0 Modems Properties NETCPL.CPL 0 Network Properties PASSWORD.CPL 0 Password Properties POWERCFG.CPL 0 Power Management Properties STICPL.CPL 0 Scanners and Cameras Properties SYSDM.CPL 0 System Properties / Device Manager SYSDM.CPL 1 Add New Hardware Wizard TIMEDATE.CPL 0 Time/Date Properties ACCESS.CPL 0 Accessibility Properties TELEPHON.CPL 0 Dialling Properties THEMES.CPL 0 Desktop Themes TWEAKUI.CPL 0 Tweak UI MSWEBCPL.CPL 0 Personal Web Server Properties ODBCCP32.CPL 0 ODBC Data Source Administration PREFSCPL.CPL 0 Real Audio Preferences Example #1: Show just the Control Panel
<OBJECT id=hhctrl type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=100 height=100>
<PARAM name="Command" value="ShortCut">
<PARAM name="Button" value="Text:Open Control Panel">
<PARAM name="Item1" value=",rundll32.exe,shell32.dll,Control_RunDLL">
</OBJECT>Example #2: Show Mouse Properties, open at page 4
<OBJECT id=hhctrl type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" width=100 height=100>
<PARAM name="Command" value="ShortCut">
<PARAM name="Button" value="Text:Mouse Properties - Page 4">
<PARAM name="Item1" value=",rundll32.exe,shell32.dll,Control_RunDLL MAIN.CPL,@0,3">
</OBJECT>See also: http://webhelp.magrino.com/_shared/2001_11/2001_11_1.htm
RunDll32.exe is a handy MS Windows OS component used to access functions in DLLs. The section above (Running Control Panel Applets) describes how to open a Control Panel Applet via a shell32.dll function. RunDll32.exe lives in %WINDIR% which is in the Windows search path so you don't need do specify the full path when executing RunDll32.exe.
MS Knowledge Base Article - 164787 describes the RunDll32 Interface.
Normally you would not want to use Word for HTML Help authoring. Word does not converted .DOC to .HTM very cleanly. Use a real HTML editor such as FrontPage.
If you must author in Word then use the free MS Office HTML Filter 2.0 tool.
http://office.microsoft.com/assistance/2000/htmlfilter.aspx
http://office.microsoft.com/Downloads/2000/Msohtmf2.aspxAlso, once compiled into HTML Help the images may not show. First send the HTML through the filter tool (above). If there is still a problem, then open the .HHP project file up in NotePad and add the images to the [FILES] section by hand. This ensures that the images are compiled into the CHM help file.
23-Aug-2003: Word 2002 (Office XP) has Filtered SaveAs
I just noticed that Word 2002 has an option in the SaveAs dialog to save as filtered HTML. So for Office XP forget the extra Filter application (thanks Linda Karma for pointing that out to me).
Problem:
It is easy to exclude a topic from an CHM Index. Simply don't declare the topic in the .HHK index file. Is there a way to exclude a topic from the Full-text search (FTS) (search tab of the HH window)?
Fix:
The HTML Help compiler parses any filename with a ".h" in the filename. So if you give the files you want to exclude say a ".xhtml" file extension then it wont be parsed for FTS information. I use ".xhtml" extension with no apparent downside.
The other way you could achieve this is to place all the non-FTS topics in one CHM and switch off the FTS feature for that CHM.
Problem:
I want my CHM topics to save/share some state information. Cookies seem to work OK in uncompressed HTML but not in a compressed CHM.
Fix:
Rob Cavicchio posted the following to the HATT group:
After a fair amount of testing I performed today, I've concluded that the only deciding factor about how well cookies work in compiled Help files is the version of IE that is installed. This is true for both .chm and .hxs files; the same considerations seem to apply to both versions of Help. In brief:
- Compiled Help cookies don't work with IE 4, and there is no workaround (as far as I can tell).
- Compiled Help cookies don't work with IE 5.0, but the workaround of calling cookie functions in an HTML file external to the compiled Help file does work.
- Compiled Help cookies do work with IE 5.5 & IE6. No workaround is needed.
- Compiled Help cookies seem to have broken again in IE6-SP1. The workaround of calling the cookie functions from an external file does seem to work.
Pete Lees continues...
Regarding point 2) & 4) I think the technique to which Rob is referring is as follows:
- Along with your .CHM, install a plain HTML file.
- Put script functions to set and retrieve cookies into the HTML file <head>.
- In a .CHM topic from which you want to use cookies, create a hidden <iframe> (can be done with style="display:none;") that contains the external HTML file.
- From the .CHM topic, call the cookie functions within the hidden <iframe> using frame references (e.g., document.frames["hidden"].cookieGet();). Make sure to set an expiration date on the cookie if you want it to last between Help sessions.
MS IE5/6 Persistence (again thanks Pete Lees)...
Maybe you can achieve what you want using "persistence" (requires IE5 or above)?
There is more information on this here:
http://msdn2.microsoft.com/en-us/library/ms533007.aspxand there is a working example in the "Microsoft HTML Help Design Techniques" file that
Scott Boggan prepared for the 2001 WinWriters Online Help Conference, available from
http://www.winwriters.com/ohc01/suppmatl/index.html.The other way to save information between pages in a CHM is to use an ActiveX control which can give you access to INI files or the Registry. I have a free DLL you can use at http://helpware.net/hwserver/. However, using such a DLL does raise the complexity of your help system. I would always recommend simple is best.
One more Tip (from Sven-Ola T ˙˙ ke):
You can also pass a string between pages using window.name, as this property is normally empty unless you are calling a function like window.Open(). This is an undocumented feature and has been around since IE3.
http://msdn2.microsoft.com/en-us/library/ms536651.aspx
http://msdn2.microsoft.com/en-us/library/ms534187.aspx
Problem:
After converting a Word DOC to HTML the Help compiler gives errors
HHC6000: Error: An internal file could not be created. Make certain there is enough disk space on the drive where you are compiling your file.
HHC5007: Error: Fatal navigational compilation error. This is likely the result of an invalid contents (.hhc) file.Fix: From Pete Lees
These error messages commonly appear if the heading tags in your HTML files contain any parameters other than the actual headings. For example, this would work:
<H1>My heading</H1>
but this wouldn't:
<H1 align="center" >My heading</H1>Fix: From Ulrich Kulle
In another cause you'll get these two error messages if you have a contents (.hhc) file that doesn't contain any TOC entries. If you add a single entry and then recompile, the messages should disappear.
You can also get these error messages if you choose the option to auto-generate the TOC -- in HTMLHelp Workshop, you do this by selecting the checkbox "Automatically create contents (.hhc) file when compiling" on the Files tab of the Project Options dialog box -- *and* you haven't any <h1>, <h2> tags in your HTML files *or* the heading tags in your HTML topic files contain one or more attributes.
So, please check your HTMLHelp Workshop properties and uncheck the checkbox (see above).
Problem:
What are my options in terms of securing a CHM from unauthorized access and copying?
Fix: (Posted by Pete Lees - thanks Pete)
Unfortunately, I don't think .chm files were designed to be secure, and there is nothing to stop anyone from decompiling them.
There are a few other techniques that you could experiment with, including:
1) Preventing users from selecting the text in a help topic and viewing the source of the topic. You can find instructions on how to do this in Simons' Help Tips file available from http://www.simon-jones.org.uk/help.htm
2) Using an HTML encrypter such as the one available at http://htmlcrypt.cedium.net (thanks to Rick Stone for drawing our attention to this). One slight drawback is that the encrypted HTML files don't show up in the results of a full-text search.
Problem:
How can I make a HH toolbar button run some script?
Fix: (Posted by Pete Lees - thanks Pete)
You can do this by linking the Jump button to a topic that contains the script. Then, using the onLoad event in this topic's <body> start-tag, you can execute the script automatically when the topic loads.
For example:
<html>
<body onLoad ="JavaScript:alert('Hello');history.back(1)">
</body>
</html>
The purpose of the "history.back(1)" method is to ensure that the most recently-viewed topic remains in the topic pane and isn't replaced by a completely blank topic.
Problem:
Marcel van Brakel has uncovered a real problem with HH_CLOSE_ALL. When you call HH_CLOSE_ALL on shut down, the HH API creates another thread and sometimes does not return until after you have performed UnLoadLibrary(hhctrl.ocx). In this case the HH_CLOSE_ALL thread returns to nothing and causes an access violation.
Discussion:
Ralph Walden (x-Microsoft) describes the problem:
The switch to a background thread was done after I left (the MS help team) in order to solve a problem with Visual Studio. I knew they should have fixed Visual Studio instead of "fixing" HTML Help (which wasn't broken). I've never actually tried it, but along with that change was a hack that allowed you to call the API in a way that it would create an interface, and then you'd call the API again to release that interface. You start off with HH_INITIALIZE and end with HH_UNINITIALIZE. Another alternative would be to set the HH_GPROPID_SINGLETHREAD property to TRUE -- that might get HTML Help back onto the parent's thread.
Fix:
- As described by Ralph above, you can try using the HH_INITIALIZE, HH_UNINITIALIZE commands. These are documented in the HH Workshop online help.
- Call HH_CLOSE_ALL earlier. Get more space between the HH_CLOSE_ALL and your call to UnloadLibrary. In VB and Delphi you would perform the call on the Form QueryUnload _not_ on the Form Close or Destroy.
- Marcel van Brakel seemed to fix it by calling Sleep(0); immediately after the call to HH_CLOSE_ALL. Again providing more time for the rogue thread to return.
More Tips:
Here is an alternative to using HH_CLOSE_ALL. What I do with my applications is keep the handle of the HH Windows when making a help call: _HHwinHwnd := htmlhelp(...) and on shutdown call:
if IsWindow(_HHwinHwnd) then
SendMessage( _HHwinHwnd, wm_close, 0, 0 );This is 10 times faster code, and eliminates the need for HH_CLOSE_ALL completely.
Also, as programming wizard Roland Mechling points out, don't blindly call HH_CLOSE_ALL on shutdown. If a user does not have HTML Help installed then this call will crash your application. Here is safer code. Notice we are checking if HH is installed before calling HtmlHelp();
procedure HHCloseAll;
begin
If @HH.HtmlHelp <> Nil then //HH API is available
begin
HH.HtmlHelp(0, nil, HH_CLOSE_ALL, 0);
Sleep(0);
end;
end;
Getting access to the HTML Help API is fairly straightforward.
This document shows you how you do it in VB: Q244140.
Once you have access to the API you call htmlhelp() with the appropriate HH command.Calling HH_CLOSE_ALL:
The example in Q244140 above is wrong. Always call HH_CLOSE_ALL as early as possible during shutdown. Form Query Unload is better than Form Unload. Form Unload will cause access violations on some machines. The problem is described in the section above. Not calling HH_CLOSE_ALL will causes an access violation if help is running on shutdown. Here is the code.
Private Sub Query_Unload(Cancel As Integer)
Call HtmlHelp(Me.hWnd, "", HH_CLOSE_ALL, 0)
End Sub.Examples of help calls:
' Opening a help topic by topic path
Call HtmlHelp(Me.hWnd, HelpFile, HH_DISPLAY_TOPIC, 0)' Where HelpFile = App.Path & "\myfile.chm
' or App.Path & "\myfile.chm::/topic.htm
' or App.Path & "\myfile.chm::/topic.htm#bookmark' Opening a help topic by Help Context ID 3099
Call HtmlHelp(Me.hWnd, App.Path & "\myfile.chm, HH_HELP_CONTEXT, 3099)API Documentation:
The HH API documentation is part of HTML Help Workshop online help.
The Workshop Installer (htmlhelp.exe) can be downloaded free from
http://msdn2.microsoft.com/en-us/library/ms670169.aspxVB6 and WhatsThis Help:
Visual Basic 5 was written pre-HTML Help. It has no built-in support for HTML Help. VB6 does support HTML Help but has a some bugs. When you specify the help file you either specify a CHM file OR you elect to use WhatsThis help and specify a path like CHMfile::/popup.txt file. If you want to use WhatsThis help then you do the latter and use the HTML Help API for your non-WhatsThis help calls.
David Liske covers using WhatsThis help with VB6 nicely at:
http://www.mvps.org/htmlhelpcenter/whcomplete.htmMore Info:
- Help Think Press Technical Paper on VB and HH programming, by MVP David Liske:
http://www.workwrite.com/helpthink/welcome.htm- Setting up help context IDs (on the help site):
http://helpware.net/htmlhelp/how_to_context.htm- See David Liskes site for more HH & VB info:
http://www.mvps.org/- Don Lammers site has some excellent tutorials:
http://www.smountain.com/m_ProgrammingHelp.htm
To gain access to the HTML Help API, you link to the Htmlhelp.lib file and include the Htmlhelp.h file in your Windows program. Both of these files are installed on your system when you install HTML Help Workshop.
For more information read your Workshop help
C++ Help: its:c:\WINDOWS\Help\api.chm::/ov_accessing.htm
HH API Help: its:c:\WINDOWS\Help\htmlhelp.chm::/apiref.htmMore Information:
- Don Lammers site has some excellent tutorials:
http://www.smountain.com/m_ProgrammingHelp.htm
- Ralph Walden has C code to access file inside a CHM.
CHM files are stored in what in techie-speak is called an IStorage format. That allows you to read any of the files within a CHM file without having to know the storage format. Source code for doing that is part of the source code package at http://www.keyworks.net/code.htm (see the CItsFile class).
If you are a component writer for VS .NET or Borland C# Builder etc. you may want to write help in MS Help 2.x and integrate your help directly into the main help collection for tightest integration.
Standalone .NET applications you create use HTML Help 1.x by default. To display help via the .NET Framework Class library, invoke the Help.ShowHelp Method (System.Windows.Forms.Help object, a static class that encapsulates the HTML Help 1.x engine.).
- Help.ShowHelp displays the TOC by default, while Help.ShowHelpIndex shows the index.
See MSDN Reference: Help.ShowHelp | Help.ShowHelpIndexThe above method appears to be a high-level call (like the ShowHelp method we use in IE Script). Most developers however access help via HelpProviders. I'm getting out of my depth here so I will direct you to an excellent article written by Michaels Waltuch where he explains HelpProviders and other help related calls:
- .NET Application Help by Michael Waltuch
Free code examples show you how to program the HTML Help API via Borland Delphi.
See the Delphi HH Kit page.
HTML Help can be opened through the System.Windows.Forms.Help object. This object is a static class that encapsulates the HTML Help 1.x engine. This class cannot be instantiated, and its methods must be called directly.
See the downloads page.
The following resources should be useful when it comes to hooking up your help file to an Office file.
Office 2000 - Adding Help to your Custom Solution:
Office 2000 - Creating your own Help Topics:
HelpAPI VBA Module:
- MS KB article (with demo) on connecting Help to .NET Applications
http://support.microsoft.com/kb/317406/en-us
- Michael Waltuch article VS .NET & CHMs
http://helpware.net/mshelp2/demo2/h1xNET.htm
- Michael Waltuch article on VS .NET Dynamic help
VS .NET Dynamic (Help 2) Help Tutorial
- Rob Chandler article on MS Help 2 collections
MS Help 2 Collection TutorialSee also MS Help 2 Info
The HH_GET_LAST_ERROR command refers to a missing file Hherror.h which can be found in the following KB article.
http://support.microsoft.com/default.aspx?scid=kb;en-us;297768
The HtmlHelp.h file has a comment with HH_GET_LAST_ERROR that say "not implemented" however it appears it is at least partially implemented. If I call HtmlHelp(0, PChar(mHelpFile), HH_HELP_CONTEXT, 911); where 911 is an invalid ContextID, then HH_GET_LAST_ERROR returned Error 0x8004020A with Description text "The compiled help (.chm) file does not contain context IDs."
For most types of errors HH_GET_LAST_ERROR appears to return 0x80004005 "Unspecified error".
HH Workshop API documents how to move to the search tab and initiate a search. Unfortunately the initiating a search part has always been broken in HH. The only way around this would be to find the HH window and search pane controls. Then control those controls from your application using via low level Windows API calls.
Dmitry Karpezo, <dkarpezo AT lycosmail.com>
posted a small code example on MSHelp2 Yahoo group - Download Example Code.
If you open a help window using the Help API, the HTMLHelp() function returns the handle of the help window. This handle can be used to manipulate the help window using standard windows API calls. Here are a few functions to get you going:
f = IsZoomed(h); //returns true if window Maximized
f = IsIconic(h); //returns true if window Minimized
f = IsWindowVisible(h); //returns true if window showing
f = IsWindow(h); //returns true if the handle is still valid (false = user has closed window)
//Set window position and size window
SetWindowPos(h, ...., SWP_SHOWWINDOW);
//Set window state
ShowWindow(h, SW_RESTORE)
ShowWindow(h, SW_SHOWMINIMIZED)
ShowWindow(h, SW_SHOWMAXIMIZED)
ShowWindow(h, SW_HIDE);
ShowWindow(h, SW_SHOW);
KeyHelp is a free ActiveX control from www.keyworks.net. A great way to extend HTML based help. It can be used in any environment that supports COM. We use it in some Delphi applications. The popup window (just one part of KeyHelp) uses an IE Browser control, so it can display anything an IE window can. And unlike the current lame CHM popups, KeyHelp can open and display any topic in your CHM.
Using KeyHelp Popups:
The trick to successfully using KeyHelp popups is to use a full path to the HTML filename you want to display. Relative paths will cause problems (well Da!). Here is a small example showing you how to expand a file name using JavaScript.
Other KeyHelp Info:
Q. How can my application access a slave topic in a merged help system.
A. This is actually not as straightforward as it may seem.
Problem:
When we compile our Japanese HTML Help project under Eng Win2K (with Japanese language pack installed), the resultant Japanese CHM looks fine, BUT... we cannot perform a search. Even if we move the CHM to a Japanese PC, the search still does not work.
In Win2K with its new Language support, shouldn't we be able to switch to Japanese and compile from there? If I compile on a pure Japanese PC the resultant Japanese CHM works fine on both my PCs.
Solution:
Marc Islam, from the MS Help development team, came back with this solution...
"You're absolutely right about Win2K and the compiler. It *should* work.
And it does... but not without a bit of work, The compiler is not Unicode enabled. As such, we rely on the system default language for our string manipulation/conversions. If the system language is not set to JPN, then portions of the compilation will fail (full text search, keyword sorting, perhaps even the storage of localized topic titles that appear in the disambiguator).To set the System default language to Japanese...
Windows 2K:
- Control Panel->Regional Options
- At the bottom, where you can check the different languages to support, click on Set Default...
- Select Japanese from the list
- Reboot, recompile, re-run the test case
Windows XP:
- Control Panel->Regional Options
- On the "Languages" page make sure make sure you check the box "Install files for East Asian languages".
- On the "Advanced" page select "Japanese" from the language dropdown list.
- Reboot, recompile, re-run the test case
Alternative Instructions: KB Article 324603
Problem:
Why don't I see Japanese characters in my Japanese HTML Help?
Solution:
This description applies to all all language translations, however we will look a Japanese.
Use a Japanese Platform:
First off, compile on a Japanese Windows machine or a Win2K/XP set up for Japanese (See above).
HTML Content:
To view HTML content correctly you will need to insert the appropriate Meta statement into the head section of each HTML file. This can be done very quickly using FAR find and replace. When you install or update Internet Explorer, make sure you install the Japanese language pack. Remember that Internet Explorer is used to display HTML content in the HH window. Use "shift_jis" for Japanese. For other codes check the HH Workshop online help.
<head>
<META HTTP-EQUIV="Content-Type" CONTENT=