怎么用delphi7 调用easychm 做出的帮助文件

解决方案 »

  1.   

    procedure TForm1.I1Click(Sender: TObject);
    begin  {}
      HtmlHelp(handle, 'x:\help\abcd.chm', HH_DISPLAY_TOPIC, DWORD_PTR(PChar('xyz.html')));
    end;最后一个参数是打开帮助文件后,直接打开的主题.
      

  2.   

    收藏!!!
    我倒是得试试
    以前一直为自动打开时候的定位发愁 不知道这样是不是可以
    我是直接ShellExecute打开的
      

  3.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
      StdCtrls;type THH_POPUP=record
        cbStruct        :integer;   // sizeof this structure
        hinst           :integer;   // instance handle for string resource
        idString        :DWord;     // string resource id, or text id if pszFile is specified in HtmlHelp call
        pszText         :pchar;     // used if idString is zero
        pt              :TPoint;    // top center of popup window
        clrForeground   :integer;   // use -1 for default
        clrBackground   :integer;   // use -1 for default
        rcMargins       :TRect;     // amount of space between edges of window and text, -1 for each member to ignore
        pszFont         :pchar;     // facename, point size, char set, BOLD ITALIC UNDERLINE
    end;type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;const
        HH_DISPLAY_TOPIC        =0;
        HH_DISPLAY_TOC          =1;
        HH_DISPLAY_INDEX        =2;
        HH_DISPLAY_SEARCH       =3;
        HH_DISPLAY_TEXT_POPUP   =$E;var
      Form1: TForm1;Function htmlhelp (hwnd : integer; lpHelpFile :PChar; wCommand,
        dwData :integer):integer; stdcall; external 'hhctrl.ocx' Name 'HtmlHelpA';implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
    var
      x:THH_POPUP;
    begin
      x.cbStruct := sizeof(THH_POPUP);
      x.hinst := 0;//Application.Handle;
      x.pszFont := 'BOLD';
      x.pszText := 'Samples for me';
      htmlhelp(Self.Handle, 'help.chm::/3.htm',HH_DISPLAY_TOPIC, 0);
    end;假设你的文件名为help.chm,里面包含一个3.htmend.