Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

How to open a help-file's contents?

How do I open a help-file so that it shows the contents-table?
0
Olli083097
Asked:
Olli083097
1 Solution
 
mark2150Commented:
I believe that topic #0 is the contents. If you pop ShowHelp with a zero for the topic ID this should give you what you're after.

M

0
 
delmarCommented:
To show the Contents tab of a WinHelp file in the Help window, use the following API call:

Declare Function WinHelp Lib "user32" Alias "WinHelpA" _
    (ByVal hwnd As Long, _
    ByVal lpHelpFile As String, _
    ByVal wCommand As Long, _
    ByVal dwData As Long) As Long

Public Sub ShowHelpContents()
 
  ' Open the help file using the
  ' 32-bit HELP_TAB constant (15)
  WinHelp hwnd, strWinHelpPath, 15, 0
 
End Sub

This procedure can then be called from the Contents menu item on any form, centralizing the procedure.  On a related note, you can call the Index tab as follows:

Declare Function WinHelpTopic Lib "user32" Alias "WinHelpA" _
    (ByVal hwnd As Long, _
    ByVal lpHelpFile As String, _
    ByVal wCommand As Long, _
    ByVal dwData As String) As Long

Public Sub ShowHelpIndex()
 
  ' Open the help file using the
  ' HELP_PARTIALKEY constant (261)
  WinHelpTopic hwnd, strWinHelpPath, 261, ""
   
End Sub

The thing to remember is that the GID file for the specific WinHelp file you're calling remembers which tab was opened last, and if a tab isn't specified, you may end up opening the wrong one.  The above functions will allow you to correctly implement both the mnuHelpContents and mnuHelpIndex functionalities with consistent behaviors.

Let me know if you need the API calls in order to do this with HTMLHelp.

David
0
 
Olli083097Author Commented:
mark2150: I have allready tryed that, and it didn't work...

delmar: Thanx! The "ShowHelpIndex" didn't work, but I have figured it out myself!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now