Solved

How to open a help-file's contents?

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Window placement 17 65
Problem to skip loop 6 50
MS Access - Capture pressed key onclick 4 21
Put text in a picture ASP.NET C# 2 37
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now