Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to open a help-file's contents?

Posted on 1998-11-16
3
Medium Priority
?
132 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 60 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

Technology Partners: 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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

618 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