Marco's Web Center

Menu for Development

Site Menu
Object Pascal Handbook
Delphi Handbooks Collection
Mastering Borland Delphi 2005
(Old) White Papers
(Old)Tools
(Old) Conferences

My Other Sites
Italian Site (www.marcocantu.it)
the delphi search

Spirit of delphi

Advertising
Home My Blog Books Object Pascal Marco

Home: Code Repository: Mastering Delphi 5

Project HELPPROJ

Project Structure


HELPPROJ.DPR

program HelpProj;

uses
  Forms,
  HelpForm in 'HelpForm.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.HelpFile := 'C:\md5code\Part5\19\HelpProj\Helpproj.hlp';
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

HELPFORM.PAS

unit HelpForm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, StdCtrls, StdActns, ActnList;

type
  TForm1 = class(TForm)
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    New1: TMenuItem;
    Open1: TMenuItem;
    N1: TMenuItem;
    Close1: TMenuItem;
    N2: TMenuItem;
    Exit1: TMenuItem;
    Help1: TMenuItem;
    Index1: TMenuItem;
    N3: TMenuItem;
    About1: TMenuItem;
    Index2: TMenuItem;
    ActionList1: TActionList;
    HelpContents1: THelpContents;
    HelpOnHelp1: THelpOnHelp;
    HelpTopicSearch1: THelpTopicSearch;
    HelponHelp2: TMenuItem;
    Action1: TAction;
    procedure Index2Click(Sender: TObject);
    procedure Index1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Index2Click(Sender: TObject);
begin
  Application.HelpContext (0);
end;

procedure TForm1.Index1Click(Sender: TObject);
begin
  Application.HelpJump ('Index');
end;

end.

HELPFORM.DFM

object Form1: TForm1
  Left = 192
  Top = 107
  Width = 544
  Height = 375
  HelpContext = 1
  BorderIcons = [biSystemMenu, biMinimize, biMaximize, biHelp]
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  Menu = MainMenu1
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object MainMenu1: TMainMenu
    Left = 24
    Top = 16
    object File1: TMenuItem
      Caption = 'File'
      object New1: TMenuItem
        Caption = 'New'
        HelpContext = 101
      end
      object Open1: TMenuItem
        Caption = 'Open'
        HelpContext = 102
      end
      object N1: TMenuItem
        Caption = '-'
      end
      object Close1: TMenuItem
        Caption = 'Close'
        HelpContext = 103
      end
      object N2: TMenuItem
        Caption = '-'
      end
      object Exit1: TMenuItem
        Caption = 'Exit'
        HelpContext = 104
      end
    end
    object Help1: TMenuItem
      Caption = 'Help'
      object Index2: TMenuItem
        Action = HelpContents1
      end
      object Index1: TMenuItem
        Action = HelpTopicSearch1
      end
      object HelponHelp2: TMenuItem
        Action = HelpOnHelp1
      end
      object N3: TMenuItem
        Caption = '-'
      end
      object About1: TMenuItem
        Caption = 'About'
      end
    end
  end
  object ActionList1: TActionList
    Left = 120
    Top = 24
    object HelpContents1: THelpContents
      Category = 'Help'
      Caption = '&Contents'
    end
    object HelpOnHelp1: THelpOnHelp
      Category = 'Help'
      Caption = '&Help on Help'
      ImageIndex = 11
    end
    object HelpTopicSearch1: THelpTopicSearch
      Category = 'Help'
      Caption = '&Topic Search'
      ImageIndex = 9
    end
    object Action1: TAction
      Category = 'Help'
      Caption = 'Action1'
    end
  end
end