Help

Create help files contents

Posted in Help

To write contents for a help file follow these steps:

    Write rtf files for each item, which need help.
    Last symbol should be "}" in these files. Everything, that follows it is necessary to remove.
    After the description of fonts and others parameters of the text, you should insert a line #{\footnote }
    <topic_name> is name of help page for your item.
    Create a help file by using the program hcw.exe, which is included in a Delphi package.
    Create a file with expansion cnt. It will be content of your help file. 

Open help file in Delphi

Posted in Help

You can use HelpFile property and HelpCommand method for TApplication class. You can use WinHelp procedure also. This example shows, how to call the Windows Help.

procedure TForm1.Button1Click(Sender: TObject);
begin
  WinHelp(Form1.Handle,nil,HELP_HELPONHELP,0);
end;

Call some topic in help file

Posted in Help

Use HelpJump to call some topic from help file. In Edit component you may write topic title. For example, if you will write "TButton_Create" then you will call topic about Create method of TButton component from vcl3.hlp file.

  Application.HelpFile := 'C:\...\Help\VCL3.HLP';
  Application.HelpJump(Edit1.Text);

Add your help file to the Delphi

Posted in Help

In Delphi3 you should do these steps 1) Copy the files MyComponent.hlp and MyComponent.cnt into the help directory of Delphi, for example (C:\program files\Borland\Delphi 3\help\). 2) Open Delphi3.cfg with a text editor 3) In the 3rd-party section at the end of this file, add the following line: :Link MyComponent.hlp 4) Delete the hidden file Delphi3.GID In Delphi4 and higher 1) Copy the files *.hlp and *.cnt into the help directory of Delphi (for example C:\program files\Borland\Delphi6\help\). 2) Start Delphi. 3) From the main menu choose Help | Customize... The OpenHelp tool starts and opens the configuration file of Delphi's online help. 4) Select the Index tab. 5) Choose Edit | Add Files..., then locate and open *.hlp files. This will merge the keywords in *.hlp file with the keyword index of Delphi's or C++ Builder's help. 6) Select the Link tab. 7) Choose Edit | Add Files..., then locate and open again your *.hlp files. This will enable context sensitive help for the component. 8) Choose File | Save Project, then close the window.

"Search" bookmark in help file

Posted in Help

If you want to give access to help file from your program., then you may use this code. You may call a "search" bookmark of some help file.

procedure TForm1.Button1Click(Sender: TObject);
var
  TempStr: string;
begin
  TempStr:='';
  Application.HelpFile:='C:\...\Help\Delphi3.HLP';
  Application.HelpCommand(HELP_PARTIALKEY, LongInt(@TempStr));
end;