Discussion:
Calling WinHelp from the command line
(too old to reply)
Nishita Kumar
2004-05-18 12:08:22 UTC
Permalink
Hi,

I know that the following command should be used to call WinHelp from
an application. I also know what all the options mean. I am confused
about the -G option.It refers to a GID file. What is a GID file? Why
would I use this option?

winhlp32.exe [[-H] [-G[n]] [-W window] [-K keyword] [-P pop-up]
[-N contextNum] [-I topicID] helpFile]

All I want to do is when I click on an icon on the user interface, the
context-sensitive help should display. It need not be a pop up, but it
should display on top (but not always on top).Which of these options
do I actually need?

Another question, I have sometimes seen applications, when you click
on the Help tab, it opens up the WinHelp table of contents. If you
click on any item in the TOC, then it opens up the contents of that
page. How is this done?

Hoping someone will be able to help me.

Nishita Kumar
Pete Lees
2004-05-18 19:36:08 UTC
Permalink
Nishita,
Post by Nishita Kumar
What is a GID file?
Here is some information from the online help that accompanies
Microsoft Help Workshop
(http://www.helpmaster.com/hlp-developmentaids-hcw403.htm).

==========

A configuration (.gid) file is a hidden file that WinHelp creates when
a Help file is first opened, or when a Help file is updated. A .gid
file contains information about the Help file, including:

* Binary representation of the contents (.cnt) file, including jumps
and commands, after it has been processed. Only topics that were found
during processing are stored.

* The filenames and titles of all Help files included in the contents
file.

* Keywords from other Help files (if :Index statements were used in
the contents file).

* List of which files have full-text search index (.fts) files.

* The size and location of Help windows and dialog boxes.

WinHelp creates a .gid file for each Help file that does not have a
contents file, or for each contents file -- even if that contents file
is for a family of Help files.

If a user deletes a .gid file, WinHelp creates a new one the next time
the user opens the Help file.

==========
Post by Nishita Kumar
Why would I use this option [-G]?
You'd use this option to rebuild the .gid file when distributing a
newer version of your help file. To quote from the Help Workshop help
file again, "If you do not run this command, users who try to access a
topic that has been changed or removed may encounter unexpected
results."
Post by Nishita Kumar
All I want to do is when I click on an icon on the user interface, the
context-sensitive help should display. It need not be a pop up, but it
should display on top (but not always on top).Which of these options
do I actually need?
Developers normally use the WinHelp API to connect help files to their
applications. See this page for links to resources describing how to
do this:

http://www.mshelpwiki.com/index.php?page=WinHelpArticles
Post by Nishita Kumar
Another question, I have sometimes seen applications, when you click
on the Help tab, it opens up the WinHelp table of contents. If you
click on any item in the TOC, then it opens up the contents of that
page. How is this done?
Can you perhaps clarify this? I'm not sure if you're describing the
standard WinHelp behaviour -- select an entry in the TOC to display
the associated topic in a new window -- or something more esoteric.

--
Pete (Microsoft Help MVP)
Nishita Kumar
2004-05-19 11:26:30 UTC
Permalink
Hi,

Thanks a lot for the information about the GID file.

My second question about the TOC...

What I meant was that when I go to the toolbar of the application and
click Help, I only get the .cnt file, when I click on any of the
topics, then the corresponding topic page opens.

I need to recreate this kind of linking where only the .cnt file opens
first.

It is probably very simple, but I have never integrated RoboHelp with
an application before, only as links from a web page.

I also need re-affirmation that using the command line syntax that I
had sent in previous posting will work.

winhlp32.exe [[-H] [-G[n]] [-W window] [-K keyword] [-P pop-up]
[-N contextNum] [-I topicID] helpFile]

I have been specifically told to research how WinHelp topics can be
called from the COMMAND LINE.

Hope you can help me.

Thanks and Regards,

Nishita
Post by Pete Lees
Nishita,
Post by Nishita Kumar
What is a GID file?
Here is some information from the online help that accompanies
Microsoft Help Workshop
(http://www.helpmaster.com/hlp-developmentaids-hcw403.htm).
==========
A configuration (.gid) file is a hidden file that WinHelp creates when
a Help file is first opened, or when a Help file is updated. A .gid
* Binary representation of the contents (.cnt) file, including jumps
and commands, after it has been processed. Only topics that were found
during processing are stored.
* The filenames and titles of all Help files included in the contents
file.
* Keywords from other Help files (if :Index statements were used in
the contents file).
* List of which files have full-text search index (.fts) files.
* The size and location of Help windows and dialog boxes.
WinHelp creates a .gid file for each Help file that does not have a
contents file, or for each contents file -- even if that contents file
is for a family of Help files.
If a user deletes a .gid file, WinHelp creates a new one the next time
the user opens the Help file.
==========
Post by Nishita Kumar
Why would I use this option [-G]?
You'd use this option to rebuild the .gid file when distributing a
newer version of your help file. To quote from the Help Workshop help
file again, "If you do not run this command, users who try to access a
topic that has been changed or removed may encounter unexpected
results."
Post by Nishita Kumar
All I want to do is when I click on an icon on the user interface, the
context-sensitive help should display. It need not be a pop up, but it
should display on top (but not always on top).Which of these options
do I actually need?
Developers normally use the WinHelp API to connect help files to their
applications. See this page for links to resources describing how to
http://www.mshelpwiki.com/index.php?page=WinHelpArticles
Post by Nishita Kumar
Another question, I have sometimes seen applications, when you click
on the Help tab, it opens up the WinHelp table of contents. If you
click on any item in the TOC, then it opens up the contents of that
page. How is this done?
Can you perhaps clarify this? I'm not sure if you're describing the
standard WinHelp behaviour -- select an entry in the TOC to display
the associated topic in a new window -- or something more esoteric.
Pete Lees [MVP]
2004-05-19 19:19:06 UTC
Permalink
Nishita,
Post by Nishita Kumar
What I meant was that when I go to the toolbar of the application and
click Help, I only get the .cnt file, when I click on any of the
topics, then the corresponding topic page opens.
If you're calling the help file from the command line then I think you'd
just use a command like this:

winhlp32 path\filename.hlp

where you can omit the path if you're calling WinHelp from the directory
that contains the help file, or you have previously registered the location
of the help file under the following key in the registry (this can easily be
done as part of the software installation process):

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Help

Provided that the .cnt file is in the same directory as the .hlp file then
the Help Topics dialog box should appear when you run the command.
Post by Nishita Kumar
I also need re-affirmation that using the command line syntax that I
had sent in previous posting will work.
winhlp32.exe [[-H] [-G[n]] [-W window] [-K keyword] [-P pop-up]
[-N contextNum] [-I topicID] helpFile]
I have been specifically told to research how WinHelp topics can be
called from the COMMAND LINE.
You can use the -K, -N or -I parameters to call individual topics. Please
see the online help for Help Workshop for more information on these
parameters, and see the online help for RoboHelp for information on how to
assign index keywords (-K), context numbers (-N) and topic IDs (-I) to your
topics. Here are a few simple examples:

To display the topic with which the index keyword "sample" is associated:
winhlp32 -K sample filename.hlp

To display the topic identified by context number 12:
winhlp32 -N 12 filename.hlp

To display the topic that has the topic ID "profile"
winhlp32 -I profile filename.hlp

--
Pete (Microsoft Help MVP)
Nishita Kumar
2004-05-21 05:44:09 UTC
Permalink
Pete,

Thanks a lot. You have been a great help :-)

Bye

Nishita
Post by Pete Lees
Nishita,
Post by Nishita Kumar
What I meant was that when I go to the toolbar of the application and
click Help, I only get the .cnt file, when I click on any of the
topics, then the corresponding topic page opens.
If you're calling the help file from the command line then I think you'd
winhlp32 path\filename.hlp
where you can omit the path if you're calling WinHelp from the directory
that contains the help file, or you have previously registered the location
of the help file under the following key in the registry (this can easily be
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Help
Provided that the .cnt file is in the same directory as the .hlp file then
the Help Topics dialog box should appear when you run the command.
Post by Nishita Kumar
I also need re-affirmation that using the command line syntax that I
had sent in previous posting will work.
winhlp32.exe [[-H] [-G[n]] [-W window] [-K keyword] [-P pop-up]
[-N contextNum] [-I topicID] helpFile]
I have been specifically told to research how WinHelp topics can be
called from the COMMAND LINE.
You can use the -K, -N or -I parameters to call individual topics. Please
see the online help for Help Workshop for more information on these
parameters, and see the online help for RoboHelp for information on how to
assign index keywords (-K), context numbers (-N) and topic IDs (-I) to your
winhlp32 -K sample filename.hlp
winhlp32 -N 12 filename.hlp
To display the topic that has the topic ID "profile"
winhlp32 -I profile filename.hlp
Loading...