How to link a PDF file in CHM files?
Here is a piece of code for opening a PDF file directly inside a CHM file provided by Sjoerd B. Franken.
Include this script in the HEAD tag
<SCRIPT Language="JScript">
function parser(fn)
{
var X, Y, sl, a, ra, link;
ra = /:/;
a = location.href.search(ra);
if (a == 2)
X = 14;
else
X = 7;
sl = "\\";
Y = location.href.lastIndexOf(sl) + 1;
link = 'file:///' + location.href.substring(X, Y) + fn;
location.href = link;
}
</SCRIPT>
Then link this way
<a onclick="parser('Your_PDF_File.pdf')" style="text-decoration: underline;
color: green; cursor: hand">Click ME Please!</a>
Notes:
The PDF file must be distributed together with the CHM file and they must be in the same directory.
Return to top
How to link an outside file in CHM files?
In fact, the SCRIPT and HTML code above(How to link an PDF file in CHM files?) is exactly the answer to this question.
You can use the code in your html files in the same way if only you replace Your_PDF_File.pdf with the outside file's name.
Return to top
How do I link from a WinHelp topic to an HTML Help topic?
Here's the correct syntax for jumping from a WinHelp topic link to a
topic in a compiled HTML Help (.chm) file:
!execfile(hh.exe,
filename.chm::/topic.htm)
where !execfile is the name of
the WinHelp macro, hh.exe is the HTML Help executable program,
filename.chm is the name of the compiled help file, and
topic.htm is the name of the HTML topic file.
Return to top
A lot of help files have links to the Control Panel. How do you define such a link for HTML Help? How do you call the Control Panel?
This is easy in WinHelp because of the ControlPanel macro. In HTML
Help you
can use the ShortCut command of HHCTRL. For example, the
following object
tag will show the Display Properties dialog box from
Control Panel:
<OBJECT id=hhctrl
type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"
codebase="hhctrl.ocx#Version=4,73,8252,0"
width=100
height=100>
<PARAM
name="Command" value="ShortCut">
<PARAM
name="Button" value="Text:Display Properties">
<PARAM
name="Item1" value=",rundll32.exe,shell32.dll,Control_RunDLL desk.cpl">
</OBJECT>
Return to top
Is there a registry key that enables me to find out if HTML Help is set up on a computer?
You can look for the CLSID of Hhctrl.ocx in
HKEY_CLASSES_ROOT\CLSID. The CLSID
is:
ADB880A6-D8FF-11CF-9377-00AA003B7A11
This key is
registered by the system during setup.
Return to top
On the Search tab in a compiled help file there is a Match similar words check box. What does this option do?
The Match similar words option uses Western-language
rules for determining suffixes and finds all occurrences of a given word
that include common suffixes. For example, a search for "run" will find
words such as "run," running," and "runner." The word "runtime" will not
be found.
Return to top
How can I make the HTML Help window remain even though the calling process has been terminated?
There is more than one way to solve this problem.
HTML Help is implemented as a DLL and is, therefore, always in-process.
It terminates when the process that creates it terminates. To keep HTML
Help around, the process that creates it must stay around.
One way to do this is to create an executable (.exe) file that calls
HTML Help. This .exe file should stay running until HTML Help is closed by
the user. You will also have to implement a method for communicating
between this .exe file and the executable file of your program.
Another solution is to load your title under Hh.exe. If you WinExec
your title, then the standard Windows file association code will load it
using Hh.exe and it will remain running until the user closes Hh.exe.
Return to top