Announcement

Collapse
No announcement yet.

opening a help file

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

  • opening a help file

    I am composing a help file with the free edition of Helpinator. When my user chooses Help from the menu, is there a API that I should call or do I just SHELL out to open it? I would also like for the user to be able to freely bring to focus the application's window or the help's window. Too often I have to print a help because I can't use the application again without closing the help.
    Erich Schulman (KT4VOL/KTN4CA)
    Go Big Orange

  • #2
    Here's the notes I have on opening Help files.

    Code:
    'bring up contents of Help file
    iResult = WinHelp(Me.hwnd, "c:\yourfile.hlp")
    
    'jump to topic (topic id=1000 in this example)
    iResults = WinHelp(Me.hwnd, "c:\yourfile.hlp", HELP_CONTEXT, 1000&)
    
    'bring up search window
    iResults = WinHelp(Me.hwnd, "c:\yourfile.hlp", HELP_PARTIALKEY, ByVal "")
    
    'quit Help
    iResults = WinHelp(Me.hwnd, "c:\yourfile.hlp", HELP_QUIT, 0&)
    WinHelp is the API.

    It's from a previous life (another language), and I've not tested it in PowerBASIC.

    Comment


    • #3
      Here's the additional info on constants for the API (MSDN site), and particularly on the values to use in the API.

      http://msdn.microsoft.com/en-us/library/aa975824(VS.71).aspx

      And here's a PB code that works.

      Code:
      #Compile Exe
      #Dim All
      #Include "Win32API.inc"
      %HELP_CONTENTS = 3
      %HELP_FINDER = 11
      Global hDlg As Dword, hCtl As Dword
      Function PBMain() As Long
            Dialog New 0, "PowerBASIC",300,300,100,75, %WS_SysMenu,0 To hDlg
            Control Add Button, hDlg, 2, "Cancel", 25, 15, 40, 20
            Dialog Show Modal hDlg Call DlgProc
      End Function
      
      
      CallBack Function DlgProc() As Long
         If CbMsg = %WM_Command Then
             WinHelp (hDlg, "win32.hlp", %HELP_FINDER, 0&)
         End If
      End Function

      Comment


      • #4
        That API page doesn't mention .chm files which is what Helpinator makes. Do I have to handle that differently? If not, I understand your PB code and would be ready to go.
        Erich Schulman (KT4VOL/KTN4CA)
        Go Big Orange

        Comment


        • #5
          Found:
          Is it possible to open a specific topic from the Hh.exe command line?

          Yes, try:
          hh mk:@MSITStore:/path/filename.chm::/path\topicname.htm
          For example, with the compiled help file htmlhelp.chm, you can use:

          hh mk:@MSITStore:htmlhelp.chm::/api.htm
          hh mk:@MSITStore:c:\windows\help\htmlhelp.chm::/flash\browse.htm
          In msdm document:
          http://msdn.microsoft.com/en-us/library/ms669980(VS.85).aspx

          Search Engine terms: chm api
          Found more: http://msdn.microsoft.com/en-us/library/ms669985.aspx
          Last edited by colin glenn; 9 Feb 2009, 11:01 PM.
          Furcadia, an interesting online MMORPG in which you can create and program your own content.

          Comment


          • #6
            Display Help files (HLP, CHM or other)
            kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

            Comment


            • #7
              Here is a 'help tester" utility. It's old and it's for WinHelp, but it should be easy to update for HtmlHelp. (maybe as a 'reply' post by some generous person?)

              PowerBASIC and related source code. Please do not post questions or discussions, just source code.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment

              Working...
              X