Announcement

Collapse
No announcement yet.

What is current best practice for including a help file within an application

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is current best practice for including a help file within an application

    I'm updating an old application that used a .HLP file to display the help document. .HLP was deprecated a while ago. Is .CHM still viable or is there a new format? If .CHM is still viable, how do you call them from an app ( I have the .CHM file, I need my app to open it)?
    Bernard Ertl
    InterPlan Systems

  • #2
    I use CHM for the desktop and HTML Help for the web systems. I found these instructions for CHM and they seemed to work the last time I did a CHM StackOverflow.
    Code:
    C:\Windows\hh.exe ms-its:[file_name.chm]::[page_name.htm]
    If the topic name is unknown, either right click in the background of the page and choose Properties or use the print idea in the original article.

    Comment


    • #3
      I found some code in the source code forum for opening a .CHM file:

      https://forum.powerbasic.com/forum/u...p-chm-or-other

      I'm guessing most every version of Windows after WinXP includes the HHCTRL.OCX library to read CHM files?
      Bernard Ertl
      InterPlan Systems

      Comment


      • #4
        Hi Bernard,

        I have used the API functions below in a very simple way a couple of times and so far it seems to work in all Windows versions.
        (My help files contains usually only 1-3 pages)
        https://docs.microsoft.com/en-us/win...api/_htmlhelp/

        Code:
        #INCLUDE "HtmlHelp.inc"
        
        'To open the content tab in my help file.
        HtmlHelp(CB.HNDL, EXE.PATH$ + "MyHelpFile.chm", %HH_DISPLAY_TOC, %NULL)
        /Mikael

        Comment


        • #5
          Minimalist version:
          '
          Code:
          #COMPILE EXE
          #DIM ALL
          #INCLUDE "WIn32API.inc"
          #INCLUDE "HTMLHelp.inc"
          
          %IDC_btnQuit = 1001
          
          FUNCTION PBMAIN() AS LONG
             LOCAL lRslt AS LONG
             LOCAL hDlg  AS DWORD
              DIALOG NEW 0, "F1 for Help", , , 200, 180, %WS_SYSMENU, TO hDlg
              CONTROL ADD BUTTON , hDlg,%IDC_btnQuit,"Quit",60,120,80,20
              DIALOG SHOW MODAL hDlg, CALL MainDlgCB TO lRslt
          END FUNCTION
          
          CALLBACK FUNCTION MainDlgCB()
              SELECT CASE AS LONG CB.MSG
                  CASE %WM_HELP
                         SHowHelp(CB.HNDL, 0)
                  CASE %WM_COMMAND
                      SELECT CASE AS LONG CB.CTL
                          CASE %IDC_btnQUIT
                              IF CB.CTLMSG = %BN_CLICKED OR CB.CTLMSG = 1 THEN
                                  DIALOG END CBHNDL
                              END IF
                      END SELECT
              END SELECT
          END FUNCTION
          
          FUNCTION ShowHelp(hwnd AS LONG,helpNum AS LONG) AS LONG
               HtmlHelp hWnd, "MyAppHelp.chm", %HH_DISPLAY_TOPIC, helpNum
          END FUNCTION
          '

          Comment

          Working...
          X