Solved

How to open a help-file's contents?

Posted on 1998-11-16
3
128 Views
Last Modified: 2010-04-30
How do I open a help-file so that it shows the contents-table?
0
Comment
Question by:Olli083097
3 Comments
 
LVL 12

Expert Comment

by:mark2150
ID: 1445063
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
 
LVL 1

Accepted Solution

by:
delmar earned 20 total points
ID: 1445064
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
 

Author Comment

by:Olli083097
ID: 1445065
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question