Using the HtmlHelp api with PB help file (Fred?)

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

I want to launch the PB help file from another program, i'm trying the HtmlHelp api but it does not work, it seems that i need the topic context ids, if so is there any chance to get them?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Just use the name (openwindow.html for example) instead of topics.. It works perfectly, as PB editor use the HTMLHelp API..

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

Thanks for the quick response, but i can't get it to work.

I tried several things in PB, for example:

#HH_DISPLAY_TOPIC=0
#HH_HELP_CONTEXT=15
#HH_INITIALIZE=28

help.s="c:\mypath\PureBasic.chm"

OpenLibrary(0,"hhctrl.ocx")
*HtmlHelp=IsFunction(0,"HtmlHelpA")

ptr.l=0
CallFunctionFast(*HtmlHelp,#null,#null,#HH_INITIALIZE,@ptr)

CallFunctionFast(*HtmlHelp,#null,help,#HH_DISPLAY_TOPIC,"openwindow.html")

CloseLibrary(0)

This launches the helpfile but without the topic and then closes.

Please, can you tell me wich command do i have to use?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

I realized that i need the full html path, but when the calling thread finishes the help file closes.

What i'm trying to do is launch the context help from an external editor. Is this possible?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

Never mind, i found an easy way using a little command line freeware tool: keyhh.exe

http://www.keyworks.net/

it allows you to launch only 1 instance of the helpfile (hh.exe launches a new one everytime is called with command line parameters)

now i already have my external editor with keyword lookup support.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Code: Select all

OpenWindow(1,1,1,120,100,#PB_Window_SystemMenu,"Open Help")
  CreateGadgetList(WindowID())
  ButtonGadget(1,0, 0,120,25,"OpenWindow")
  ButtonGadget(2,0,25,120,25,"Index")
  ButtonGadget(3,0,50,120,25,"Intro")

#PB_CHM.s = "c:\program files\purebasic\purebasic.chm"

Repeat
  Select WaitWindowEvent()
     Case #PB_EventCloseWindow: End
     Case #PB_EventGadget
          Select EventGadgetID()
             Case 1: OpenHelp(#PB_CHM,"Window/openwindow.html")
             Case 2: OpenHelp(#PB_CHM,"")
             Case 3: OpenHelp(#PB_CHM,"MainGuide/intro.html")
          EndSelect
  EndSelect
ForEver
Works fine here.

Fred should remove all the PATHs within the
.chm file.
The look doesnt change this way, but you could
use it with an external editor (like win32.hlp).

cya,
...Danilo

(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Justin.

Yes, but i was looking for the api to execute it with the editor scripting language, what this editor does (Winedit) is to add an entry to the editor context menu "Keyword Lookup", when you click on it you can execute a script, my script gets the word and performs a big select/endselect, if it finds the word runs keyhh.exe with the appropiate parameters to launch the specified help topic. The same effect as the PB editor.

I automated the process of writing the script, also i have another script to comment and uncomment entire blocks of code.

I don't know if other editors support this, but this one is cool.
Post Reply