| |
|
HelpHikes Pro, Questions and Answers
|
Remember, this database will grow depending on the questions you ask. So, please feel free to write back and ask questions.
|
|
|
|
HelpHikes Pro: Beginner's questions
|
Question 14:
I have just started using HelpHikes Pro. I added about 5 topics to a document and could create my first help file very easily. But, the Contents topic simply lists all the five topics with no formatting. How can I get a better Contents topic?
(modified: 27 May 2003)
Question 15:
I have generated a sample help file using HelpHikes Pro, but don't know how to activate it from an application. Any hints?
(modified: 10 Jun 2003)
Question 16:
I created a small help file, the program works great. My only problem is I cannot get the help file title to show the title that I specified in Help Generation Options Dialog. It always shows "Untitled Help" instead of "My Help File". Why?
(modified: 10 Jun 2003)
Question 17:
Where can I find more information on VB integration with Windows help files?
(modified: 11 Jun 2003)
|
|
|
|
14: I have just started using HelpHikes Pro. I added about 5 topics to a document and could create my first help file very easily. But, the Contents topic simply lists all the five topics with no formatting. How can I get a better Contents topic?
|
Date added/modified: 27 May 2003
There are two answers to your question. The first tells how you can have your own Contents topic. The second tells how you can have a nice Help Topics dialog box with collapsible book of contents.
1) Having your own contents topic: Just add a topic with the name Contents and format it the way you want.
Drag and drop Jump links to topics the same way that you add them to
regular topics and it will become the your contents topic.
2) Better and standard alternative This is better as it will present a dialog with Contents and you
can have levels too. This is described in the help file under "CNT File Contents." But, still I will try to outline a simple procedure to do that.
PROCEDURE TO ADD CONTENTS DIALOG:
- Just add a topic with the name ~cntFileContents
- Add the following lines to it with your own file name and title.
:Base helpfile.hlp
:Title Your Help Title
:Index Help features=helpfile.hlp
- Below this, you are ready to define your levels.
1 Any text for the first book icon (category name)
2 [~jump any of your topic]
2 [~jump any of your topic]
1 Any text for the second book icon (category name)
2 Any text for a subcategory name
3 [~jump any of your topic]
4 [~jump any of your topic]
- Then compile and see how it looks. Then you will understand
what is going on.
|
|
|
|
15: I have generated a sample help file using HelpHikes Pro, but don't know how to activate it from an application. Any hints?
|
Date added/modified: 10 Jun 2003
There are two ways to show a help file from an application. Directly call WinHelp windows API function or use your SDK specific methods. We will briefly describe both of them here:
Using WinHelp directly: This is completely documented in the win32 help documentation (win32.hlp). Here is the function prototype in win32 docs:
BOOL WinHelp(
HWND hWndMain, // handle of window requesting Help
LPCTSTR lpszHelp, // address of directory-path string
UINT uCommand, // type of Help
DWORD dwData // additional data
);
Basically, you pass a handle to the main window, the full name of the help file and a command with some optional data. For example, the command to display the help topics dialog is HELP_FINDER (no data required). You will
call this something like this:
WinHelp(handle, theHelpFileName, HELP_FINDER, 0)
For other more advanced uses like calling context sensitive help, please see the note at the end of this section.
Using SDK specific methods: Most of the Windows development kits have their own shorter versions of the above call where you don't need to pass the main window handle and the help file name. Typically, you would do the following:
- Set up the help file name in the application object. You can do it in the IDE or in code. But, I would recommend using the code as it allows you to set a full help file name which will never fail even if current directory is different. In Delphi, in your main form's formcreate event, you set Application.Helpfile to the full path name of your help file. Here is some sample code:
Application.HelpFile := extractfilepath(application.exename)+'myapp.hlp';
In Visual Basic, you would do something similar to set App.HelpFile.
- Then, call the language specific shorter version of the winhelp call. For example, in Delphi, you simply call application.helpcommand(HELP_FINDER, 0). In Visual Basic, I don't know if there is a shorter call but the following will work:
WinHelp(frmMain.hWnd, App.HelpFile, HELP_FINDER, ByVal 0&)
- Similarly, you can display a specific topic too. You would normally pass command as HELP_CONTEXT and the data as context number for that topic.
Some Visual Basic programmers use the Common Dialog Control to call the help file. For example, they drop the common dialog control on the main window (if not already there). Then, call it like this:
With frmMain.CommonDialog1
.HelpFile = App.HelpFile
.HelpContext = targetTopicId
.HelpCommand = cdlHelpContext
.HelpKey = ""
.ShowHelp
End With
More advanced usage for Context Sensitive help: As you can see, basically it is all a variation on using the WinHelp API. The best source of the details is the documentation of WinHelp API call. Then, it is upto you how you use it in your programming language. The main thing to remember is that you must use a full path name of the help file otherwise, the help may not work if the application changes the directory. Showing Windows help may be simple or complex depending on your requirements. For example, if you must always show a context sensitive help topic in a secondary window to the right of the screen, you must prepare your help file accordingly, and you may also need to tweak your programming code. You will find details on various features of context sensitive help in the "Programmer's corner" section in the HelpHikes Pro help file. Some examples for Delphi are also included in my tips for Delphi programmers: Help Integration in Delphi applications.
|
|
|
|
Copyright 1995-2008, AvniTech Solutions. All rights reserved.
|
|
|