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

delphi调用chm帮助文件实例

2010-04-23 15:12 423 查看
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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: