Delphi HH Kit
The Delphi HH Kit is a free download for Delphi 2/3/4/5/6/7/etc. It consists of 2 units & doc file. The first unit is a port of C++ header file "HtmlHelp.h".
The second is a library of HTML help related functions "hh_funcs.pas".
We also provide a suite of advanced HH Code Examples (see below).
- Read the Kit Documentation and Change Notes - (hh_doc.txt)
- Download "The Kit" version 2.1" - (delphikit2.zip) size: 32KB, 3-Dec-2009
- Make sure you grab version 2.1 if you use Unicode Delphi 2009 or greater.
- Unicode version now compatible with Delphi 6/7/ .. Delphi 2010.
- HH_Funcs.pas utility now compiles under D2010. Ansi and Unicode versions of funcs.
- HH.pas - HTMLHelp() function defaults to either Ansi or Unicode depending on the version of Delphi.
- Download "The Kit" version 1.09" - (delphikit1.zip) Size: 32KB, 27-Aug-2008
- Ansi version for Delphi 2/3/4/5/6/..
- Fix bug with Windows Vista compatibility.
- Updated D6OnHelpFix.pas to fix small memory leak on shutdown.
Remember that in Delphi 2006 and above (I think) the system file Windows.pas now defines the HtmlHelp() API function for you. So consider using that if all you just need to launch help.
The suite of code examples (see below) are compatible with Delphi 2/3/4/5/6.. 2009/2010. These can be downloaded from the HH Kit Yahoo group Files area.
C++ Builder HH Kit
Marcel van Brakel has begun the work of converting the Delphi HH Kit, into C++Builder for Project Jedi
Want to know how to code for MS HTML Help in Borland C++ Builder? Marcel van Brakel has begun the work of converting the Delphi HH Kit examples (above) into Borland C++ Builder code. This is must-have code for all Borland C++ builder developers.
Status: Free Code & Examples.
V1.0 2002-1-22: Original upload. Contains 4 code example.
V1.1 2003-6-11: Fix uninitialized variable in Example2\unit1.cpp. Was: "DWORD PathSize;" Now: "DWORD PathSize = 255;"
Author(s): Marcel van Brakel
D6OnHelpFix.pas - OnHelp Event Fix for Delphi 6/7/8/.. & C++ Builder 6/..
Delphi 6 and above broke the OnHelp event which we rely on to override the Delphi WinHelp system (you will notice the some help events no longer fire). Please make sure you download "Delphi Example 12" which includes a fix file (D6OnHelpFix.pas). All you need to do is include the D6OnHelpFix.pas unit anywhere in your project and all help events will then fire as they did in Delphi 3/4/5. Delphi 2009+ seems to have fixed the problem and wont require the fix.
Delphi 6 has broken the TForm.OnHelp & TApplication.OnHelp events. OnHelp now only catches a few help events. OnHelp was the easiest way to convert a program over to using non-WinHelp online help. The fix is a unit (D6OnHelpFix.pas) you simply use in your project. Documentation is provided with the download. There is also a small demo. The fix works for Delphi 6 and above as well as C++ Builder 6 and above.
Free Code & Example.
- 16 May 2003 - Demo's now display the Keyword field help correctly.
- 3 Feb 2003 - Fixes a problem where lockup occurs when a .HLP help file is specified for the project. Thanks to Paul van der Eijk for the fix.
- 5 Nov 2002 - Allows the code to work for Delphi 7 as well, which still requires the fix.
- 7 Jan 2006 - Plug small 20 byte memory leak. Thanks Trond Grøntoft and Daniel Waeber.
- 27 Aug 2008 - Added changes made by Steffen Deckert to again address the small shutdown memory leak (tested D6 & D7).
Rob Chandler, Marcel van Brakel
C++ Builder Instructions
Borland C++ Builder 6 has the same problem (since Delphi and C++ Builder share the same VCL code).
Bernward Mock kindly describes how he uses the Delphi OnHelp Fix in his Borland C++ Builder projects.
Here are the steps I performed in BCB6:
- I copied "D6OnHelpFix.pas" into my project directory
- "Compilers_.inc" must be also present in this directory
- In the project menu, I choosed "Add to project..." -> Pascal-Unit and added "D6OnHelpFix.pas" (I have a german version of BCB6, I don't know if "Add to Project..." is the correct term)
- Run the project (a D6OnHelpFix.hpp and D6OnHelpFix.dcu were created by this step)
Thats all. There is no need for a #include.
The Delphi Code Examples
The code examples show you how to program all HTML Help API commands, how to embed the IE WebBrowser and HH windows into your Delphi applications, how to write "What's This" help, how to create ActiveX extensions for Chm Help files, and how to change your WinHelp based applications over HTML Help. And much more.
24-Feb-2006 - Minor update - Updated core files hh.pas, hh_funcs.pas, D6OnHelpFix.pas.
||Accessing the HH API using static loading. Common HH API commands.
||Accessing the HH API using dynamic loading. Common HH API commands.
||Hooking help events in Delphi. Moving from WinHelp to HTML Help.
||Advanced HTML Help API calls. What's this help.
||Embedding Internet Explorer TWebBrowser control into Delphi applications.
||Embedding HH windows in Delphi applications.
||Extending HTML Help using ActiveX.
||Finding open HH windows. Manipulating HH windows.
||How to modifying a HH window using low level windows API calls.
||CHM Explorer demo. How to read the contents of a CHM file.
||Programming KeyHelp.ocx interfaces and methods.
|Fix for Delphi 6/7/8/etc applications that use the Delphi OnHelp event.
Download the latest version of Example 12 - (example12.zip) now supports D7/D8/... Not required for Delphi 2009 ().
||Internet Explorer 5 silent installer source code.
For more information see the readme.txt file in each example folder.
Downloading the Code Examples
To get the code examples you need to subscribe to our "DelphiHHKit" EGroup Newsletter.
How to Download HH Kit 1.09
- So you can get access to the "DelphiHHKit" files section where the code is stored.
- So we can keep track of how many people are using our code. As long as we know people are using it we will continue to maintain the code.
- So we can notify you of any corrections or updates.
Go to the "DelphiHHKit" Yahoo Group and Subscribe
Go to the "DelphiHHKit" files area and click the required download
For convenience we recommend that you download the ZIP containing the compiled EXEs. There is also a ZIP that excludes the EXEs if you want to reduce download time and compile the examples yourself.
Note that all EXEs have been compressed with UPX, hence their relatively small shipping size.
Once you have the code you are free to unsubscribe, but we hope you will stay on so we can keep you up to date. We plan to post members 1-4 times a year depending on what develops.
Delphi HH Kit 2.1 for Delphi 2006/2009/2010
Posted on Dec 3rd 2009
hh.pas – The HtmlHelp() function is either Ansi or Unicode depending on the Delphi you are running (Delphi 2009 + is Unicode).
hh_funcs.pas – Now compiles under Delphi 2010.
As I understand it Delphi 2006 and up now has the basic HtmlHelp() API declaration in Windows.pas. So consider using that instead of hh,pas if you just need to do basic calls to open help.
Also I believe that Delphi 2009 and up has fixed the “Help Events not firing” bug. So our special unit D6OnHelpFix.pas should not be required on newer Delphi systems.