H
hui717
Unregistered / Unconfirmed
GUEST, unregistred user!
这样写代码,总是不对,或者根本就调不出来
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
Edit1: TEdit;
Button1: TButton;
procedure BitBtn1Click(Sender: TObject);
function FormHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function HtmlHelpA (hwndcaller:Longint; lpHelpFile:string; wCommand:Longint;dwData:string): HWND;stdcall; external 'hhctrl.ocx';
implementation
uses Unit2;
{$R *.dfm}
procedure ShowChmHelp(sTopic:string);
var i:integer;
begin
i:=HtmlHelpA(Application.Handle,Pchar(extractfilepath(application.ExeName)+'help.chm'),2,sTopic);
if i=0 then
begin
Showmessage('help.chm 帮助文件损坏!');
exit;
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
OKBottomDlg.ShowModal();
end;
function TForm1.FormHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
begin
case Data of
10100: ShowChmHelp('1.html');
10101: ShowChmHelp('2.html');
else ShowChmHelp('3.html');
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowChmHelp('4.html');
WinExec(PChar('help.chm::1.htm'),sw_normal);
end;
end.
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons;
type
TForm1 = class(TForm)
BitBtn1: TBitBtn;
Edit1: TEdit;
Button1: TButton;
procedure BitBtn1Click(Sender: TObject);
function FormHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
function HtmlHelpA (hwndcaller:Longint; lpHelpFile:string; wCommand:Longint;dwData:string): HWND;stdcall; external 'hhctrl.ocx';
implementation
uses Unit2;
{$R *.dfm}
procedure ShowChmHelp(sTopic:string);
var i:integer;
begin
i:=HtmlHelpA(Application.Handle,Pchar(extractfilepath(application.ExeName)+'help.chm'),2,sTopic);
if i=0 then
begin
Showmessage('help.chm 帮助文件损坏!');
exit;
end;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
OKBottomDlg.ShowModal();
end;
function TForm1.FormHelp(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
begin
case Data of
10100: ShowChmHelp('1.html');
10101: ShowChmHelp('2.html');
else ShowChmHelp('3.html');
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
ShowChmHelp('4.html');
WinExec(PChar('help.chm::1.htm'),sw_normal);
end;
end.