#DEFINE HH_DISPLAY_TOPIC 0x0000 #DEFINE HH_DISPLAY_TOC 0x0001 #DEFINE HH_DISPLAY_INDEX 0x0002 #DEFINE HH_DISPLAY_SEARCH 0x0003 && not currently implemented #DEFINE HH_HELP_CONTEXT 0x000F && display mapped numeric value && in dwData *!* Get the HelpContextID of the active control. LOCAL cHelpFile, wHnd, nCommand, cTopic *!* HTML help topic page cTopic = "" *!* This is a custom property on the form. *!* It can be set in a base/sub class definition cHelpFile = THISFORM.HTMLHelpFile *!* This is a custom property on the object. *!* It can be set in a base/sub class definition IF !USED("CEMHEADER") USE CEMheader IN 0 ENDIF SELECT CEMheader SET ORDER TO 1 GO top LOCATE FOR helpcontex = THISFORM.HelpContextID IF !EOF() IF THISFORM.HelpContextID > 0 cTopic = ALLTRIM(cemheader.HELPDIR)+"\"+JUSTFNAME(ALLTRIM(cemheader.helptopic)) ELSE cTopic = JUSTFNAME(ALLTRIM(cemheader.helptopic)) ENDIF ELSE GO top ctopic = JUSTFNAME(ALLTRIM(cemheader.helptopic)) endif *!* Active window wHnd = 0 *!* If there is not topic, goto TOC nCommand = IIF(EMPTY(cTopic), HH_DISPLAY_TOC, HH_DISPLAY_TOPIC) DECLARE INTEGER HtmlHelp IN "HHCtrl.ocx" ; INTEGER nHWND, ; STRING cHelpFile, ; INTEGER nCommand, ; STRING cTopic *!* Get the active window handle DECLARE INTEGER GetFocus IN "user32" wHnd = GetFocus() IF wHnd = 0 =MESSAGEBOX("Unable to get window handle.") RETURN ENDIF *!* Call the HTML help system Set Topic Id To Thisform.HelpContextId HELP nRetVal = HtmlHelp(@wHnd, @cHelpFile, @nCommand, cTopic) && this is the correct command but did not open with activex control. USE IN cemheader RETURN