Author: | Eric Aling (03 okt 2000) |
Accessed: |
HTMLHelp is quite easy to use within PB. You only need to call
the right functions. HTMLHelp files, or Compiled HTML files, have the extension
.CHM. In fact, it's an archive of HTM files. So, to display a certain topic, you
need to display a certain HTM file that resides in the .CHM file.
Mickeysoft has provided an OCX that we can use for this, the HHCTRL.OCX control.
Here's some code that helps you on your way:
External functions:
function long HtmlHelpA ( ulong hwnd, string sHelpFile, long lc, long ld ) library 'hhctrl.ocx'
function long HtmlHelpA ( ulong hwnd, string sHelpFile, long lc, string ld ) library 'hhctrl.ocx'
// constants:
integer HH_DISPLAY_TOPIC = 0
integer HH_DISPLAY_TOC =1
integer HH_DISPLAY_INDEX =2
integer HH_HELP_CONTEXT = 16
function to call the CHM file:
String ls_HelpFile
String ls_Topic
// set the helpfile
ls_HelpFile = 'yourhelpfile.chm'
// if you want to display a topic, specify the htm file of the topic. ls_topic may be empty
ls_topic = 'one_html_file_in_your_chm_file'
if ls_Topic = '' then
HTMLHelpA(handle(w_yourwindow), ls_HelpFile + '> main' ,HH_DISPLAY_TOC,0)
else
HTMLHelpA(handle(w_yourwindow), HH_DISPLAY_TOPIC, ls_topic + '.htm')
end if
That's all. HTH