hhex2.pp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. Program hhex2;
  2. {
  3. Small example/test of the html help OCX.
  4. Marco van de Voort (C) 2009
  5. Copy rtl.chm from the CHM distribution to this dir. Test keyword/alink search.
  6. }
  7. Uses HTMLHelp;
  8. var
  9. keyword : ansistring;
  10. HelpfileName : AnsiString;
  11. htmltopic : AnsiString;
  12. res : Integer;
  13. ah : PHH_AKLINK ;
  14. Begin
  15. Helpfilename:='rtl.chm';
  16. keyword:='Sysutils' ;
  17. New(ah);
  18. fillchar(ah^,sizeof(ah^),#0);
  19. ah.cbstruct:=sizeof(tagHH_AKLINK);
  20. ah.fReserved := FALSE ;
  21. ah.pszKeywords :=pansichar(keyword);
  22. ah.pszUrl := NIL ;
  23. ah.pszMsgText :='Text succes' ;
  24. ah.pszMsgTitle :='Text fail';
  25. ah.pszWindow := NIL ;
  26. ah.fIndexOnFail:= false;
  27. Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_INDEX,PTRUINT(PAnsiChar(Keyword)));
  28. // keyword search seems to have same effect.
  29. Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_ALINK_LOOKUP,PTRUINT(AH));
  30. writeln(ah.pszkeywords);
  31. writeln(ah.pszurl);
  32. writeln(ah.pszmsgtext);
  33. writeln(ah.pszmsgtitle);
  34. writeln(ah.pszwindow);
  35. writeln(res);
  36. readln;
  37. end.