Hook Clarion Help with the HelpEngine CwHelp.INT not Prop:HelpHook

A question was recently asked about hooking help on Sv.clarion.clarion11 (sv.clarion.clarion11) - Subject: own (help) routine called Mon, Jan 11 2021 1:19 am

On Mon, Jan 11 2021 1:19 am, Bernd Scheloske [email protected] said:
I am looking for a way to call a custom routine instead of calling the help F1 in an application.

{PROP:Libhook, xx} PROP:HelpHook ??

How could this be implemented?

At CIDC 2019 I covered the Clarion 8 HelpEngine Interface that is the published way to hook help in Clarion. There is no Prop:HelpHook. I created a GutHub Repo with code from CIDC that implements the HelpEngine. This is undocumented by SV beyond what is in the INT file.

It was not that hard to figure out. It is much better than a simple hook because it allows you to use the SV CHM Help Engine. You can also create a kind of help shim that inserts itself into help opening. Dries did this to log end user help usage to Google Antilytics.

Please use this thread to ask questions on how to make this work.

! From LibSrc \ Win \ Property.CLW - Note its an "Array" so SYSTEM{PROP:HelpEngine,x}. My tests show maximum is 16.

PROP:HelpEngine         EQUATE (7D40H) ! array[integer]

! Below is the CwHelp.INT file from LibSrc\Win. The comments on the EQUATE's are mine:

                            !Clarion Sends When                   !HtmlHelp #define differs
HCMD_CLOSE       EQUATE(0)  ! Program closing                      <> 12 HH_CLOSE_ALL
HCMD_SHOWTOPIC   EQUATE(1)  ! STD(STD:Help) or F1 or HELP(,'xx')   <> 0  HH_DISPLAY_TOPIC
HCMD_SHOWINDEX   EQUATE(2)  ! STD(STD:HelpIndex)                   == 2  HH_DISPLAY_INDEX
HCMD_SHOWTOC     EQUATE(3)  ! RTL needs a STD:HelpTOC              <> 1  HH_DISPLAY_TOC
HCMD_SHOWSEARCH  EQUATE(4)  ! STD(STD:HelpSearch)                  <> 3  HH_DISPLAY_SEARCH
HCMD_HELPONHELP  EQUATE(5)  ! STD(STD:HelpOnHelp)                        Not Available

HelpEngine       INTERFACE
! Parameter:
! - extension of the help file's name
Match              PROCEDURE(CONST *CSTRING),BOOL
! Parameters:
! - Window handle returned by PROP:Handle for a WINDOW or a control
! - Name of help file
! - Help command (HCMD_xxx or extended command code)
! - Additional parameter dependent from the command
HelpCmd            PROCEDURE(UNSIGNED, <CONST *CSTRING>, UNSIGNED, LONG=0),BOOL,PROC
                 END

Thanks to ClarionLive it’s now free to view my CIDC 2017 presentation on Help. Open the below page and scroll to bottom link “Displaying Help in your Clarion Application”.

https://www.cidc2017.com/Streaming