您的位置:首页 > 编程语言 > Delphi

delphi调用chm帮助文件实例

2009-02-16 10:39 344 查看
delphi调用chm帮助文件实例

发布时间:2008-6-2 10:57:26 点击:118

delphi 中如何调用 CHM格式的帮助文件,包括一些其他细节的调用,谢谢!
---------------------------------------------------------------

用winexec
---------------------------------------------------------------

Uses ShellAPI
ShellExecute(handle, 'open', 'C:/wjiachun.chm',nil, nil, sw_ShowNormal);
---------------------------------------------------------------

implementation

uses ShellAPI;

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
ShellExecute(0, 'open', PChar(Application.HelpFile), nil, nil, SW_SHOW);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.HelpFile := 'g:/NetShow.chm';
end;

————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
---------------------------------------------------------------

或者:
implementation

{$R *.dfm}

function HtmlHelpA(hwndCaller: THandle; pazFile: String;
uCommand, dwData: DWord): DWord; stdcall external 'hhctrl.ocx';

procedure TForm1.Button1Click(Sender: TObject);
begin
HtmlHelpA(Handle, Application.HelpFile, 0, 0);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
Application.HelpFile := 'g:/NetShow.chm';
end;

————————————————————————————————————
宠辱不惊,看庭前花开花落,去留无意;毁誉由人,望天上云卷云舒,聚散任风。
————————————————————————————————————
---------------------------------------------------------------

function HtmlHelp(hwd : integer;pszFile : String;uCommand :Integer;dwData :LongInt):integer; stdcall;external 'HHCtrl.ocx' name 'HtmlHelpA';

procedure TForm1.Button1Click(Sender: TObject);
begin
Htmlhelp(self.handle,'help/help.chm',0,0);
end;

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: