//以下函数及定义作为公有函数和变量,方便各个窗口调用。 type procedure ShowChmHelp(sTopic: String); //里面的sTopic参数为各个HTML页面的文件名 var const HH_DISPLAY_TOPIC=0; SHORT_CUT_F1=3866625; function HTMLHelpA(hwndcaller: Longint; lpHelpFile:String; wCommand: Longint; dwData: String):HWND;stdcall;external 'hhctrl.ocx' name 'HtmlHelpA'procedure ShowChmHelp(sTopic: String); var i: integer; begin i:=HtmlHelpA(Application.Handle,PChar(ExtractFilePath(Application.ExeName) +'\help.chm'),HH_DISPLAY_TOPIC,sTopic); if i=0 then begin MessageDlg('帮助文件损坏或遗失!'#13'请与程序供应商联系。',mtError,[mbOK],0); exit; end; end;//以下过程在相应的界面中加入 procedure TMainForm.FormShortCut(var Msg: TWMKey; var Handled: Boolean); begin if Msg.KeyData=SHORT_CUT_F1 then ShowChmHelp('Overview.htm'); end;
联系我!
QQ:4836401 请注明是CSDN上的朋友。
type
procedure ShowChmHelp(sTopic: String); //里面的sTopic参数为各个HTML页面的文件名
var
const
HH_DISPLAY_TOPIC=0;
SHORT_CUT_F1=3866625;
function HTMLHelpA(hwndcaller: Longint; lpHelpFile:String;
wCommand: Longint; dwData: String):HWND;stdcall;external 'hhctrl.ocx' name 'HtmlHelpA'procedure ShowChmHelp(sTopic: String);
var
i: integer;
begin
i:=HtmlHelpA(Application.Handle,PChar(ExtractFilePath(Application.ExeName)
+'\help.chm'),HH_DISPLAY_TOPIC,sTopic);
if i=0 then
begin
MessageDlg('帮助文件损坏或遗失!'#13'请与程序供应商联系。',mtError,[mbOK],0);
exit;
end;
end;//以下过程在相应的界面中加入
procedure TMainForm.FormShortCut(var Msg: TWMKey; var Handled: Boolean);
begin
if Msg.KeyData=SHORT_CUT_F1 then
ShowChmHelp('Overview.htm');
end;