function HH; begin Result := 0; if (Assigned(HtmlHelpA)) then begin Result := HtmlHelpA(hwndCaller, pszFile, uCommand, dwData); end; end;
function HtmlHelpInstalled: Boolean; begin Result := (Assigned(HtmlHelpA)); end;
initialization begin HtmlHelpA := nil; OCXHandle := LoadLibrary('HHCtrl.OCX'); if (OCXHandle <> 0) then begin HtmlHelpA := GetProcAddress(OCXHandle, 'HtmlHelpA'); end; end;
finalization begin if (OCXHandle <> 0) then FreeLibrary(OCXHandle); end; end. //-----------------------------------------------
procedure TForm1.FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); begin if Key = vk_f1 then begin if HtmlHelpInstalled = True then begin RetCode := HH(Form1.Handle, PChar(MYHELP_FILE), HH_HELP_CONTEXT, ActiveControl.HelpContext); Key := 0; //eat it! end else helpfile := 'hhtest.hlp'; end; end; Взято с сайта http://www.swissdelphicenter.ch/en/tipsindex.php