Solved

How to open a help-file's contents?

Posted on 1998-11-16
3
125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

914 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now