* Two demoes for htmlhelp header.

git-svn-id: trunk@13656 -
This commit is contained in:
marco 2009-09-05 23:36:19 +00:00
parent 1503890756
commit f60a4e31a2
3 changed files with 91 additions and 0 deletions

2
.gitattributes vendored
View File

@ -5056,6 +5056,8 @@ packages/winunits-base/src/wininet.pp svneol=native#text/plain
packages/winunits-base/src/winver.pp svneol=native#text/plain
packages/winunits-base/tests/OOHelper.pp svneol=native#text/plain
packages/winunits-base/tests/OOTest.pp svneol=native#text/plain
packages/winunits-base/tests/hhex.pp svneol=native#text/pascal
packages/winunits-base/tests/hhex2.pp svneol=native#text/pascal
packages/winunits-base/tests/testcom1.pp svneol=native#text/plain
packages/winunits-base/tests/testcom2.pp svneol=native#text/plain
packages/winunits-base/tests/testver.pp svneol=native#text/plain

View File

@ -0,0 +1,43 @@
Program Hhex;
{
Small example/test of the html help OCX.
Marco van de Voort (C) 2009
Copy ref.chm from the CHM distribution to this dir.
}
{$mode objfpc}{$H+}
uses htmlhelp;
var
HelpfileName : AnsiString;
htmltopic : AnsiString;
res : Integer;
Begin
Helpfilename:='ref.chm';
htmltopic := 'ref/refli3.html';
Writeln('Html example 1');
Writeln('note: Copy ref.chm from the CHM distribution to this dir');
// HH_DISPLAY_INDEX or HH_DISPLAY_SEARCH work too.
Writeln('calling TOC');
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_TOC,0);
Writeln('program now blocked on readln, press enter (in console window) to continue');
readln;
writeln('Showing a topic that is probably about dialog.');
// probably because due to automatic generation filenames and exact contact can drift.
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_TOPIC,ptruint(pchar(htmltopic)));
Writeln('program now blocked on readln, press enter (in console window) to continue');
readln;
Writeln('ready. Note that the windows die automatically on exit of the program');
{
Not demoed yet : HH_HELPCONTEXT. Load on ID, because we have no files that do that yet
}
end.

View File

@ -0,0 +1,46 @@
Program hhex2;
{
Small example/test of the html help OCX.
Marco van de Voort (C) 2009
Copy rtl.chm from the CHM distribution to this dir. Test keyword/alink search.
}
Uses HTMLHelp;
var
keyword : ansistring;
HelpfileName : AnsiString;
htmltopic : AnsiString;
res : Integer;
ah : PHH_AKLINK ;
Begin
Helpfilename:='rtl.chm';
keyword:='Sysutils' ;
New(ah);
fillchar(ah^,sizeof(ah^),#0);
ah.cbstruct:=sizeof(tagHH_AKLINK);
ah.fReserved := FALSE ;
ah.pszKeywords :=pansichar(keyword);
ah.pszUrl := NIL ;
ah.pszMsgText :='Text succes' ;
ah.pszMsgTitle :='Text fail';
ah.pszWindow := NIL ;
ah.fIndexOnFail:= false;
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_DISPLAY_INDEX,PTRUINT(PAnsiChar(Keyword)));
// keyword search seems to have same effect.
Res:=HtmlHelpA(0,pchar(helpfilename) ,HH_ALINK_LOOKUP,PTRUINT(AH));
writeln(ah.pszkeywords);
writeln(ah.pszurl);
writeln(ah.pszmsgtext);
writeln(ah.pszmsgtitle);
writeln(ah.pszwindow);
writeln(res);
readln;
end.