Note: You cannot run the demo app without createing the required registry keys.

Introduction

If you have ever used Microsoft Office 2000, you will have encountered the
help viewer at some time. I'm not talking about that pesky paper clip, but the
custom HTML Help viewer Office 2000 uses. The Office 2000 help viewer allowed
you to dock it to the left or the right of the screen, float it on top of your
desktop, or minimize it if it is not needed. It also auto-hides if you leave
it alone.

This program attempts to copy as much of the functionality of the Office 2000
help viewer as possible. You can float the window. You can dock it to the left
or the right of the screen (it even 'snaps' to the edge!). You can minimize
and maximize it (maximization is only as large as an Explorer Appbar can go,
rather than full screen). You can also choose to have the viewer auto hide (scroll
off the edge of the screen, like an auto hiding taskbar). Not only that, but
you shouldn't need to modify a single line of code to use it with your app (it
is an external program). This means that a program written in any language that
can use the Windows registry can use it. The source code is included with this
article in the hope that some people with a little free time can help to add
the other features the Office 2000 help viewer has, such as the contents, index
and search tabs. I could add them if I had time, so you may find an update following
this article...

Quick Guide

As mentioned above, the help viewer is a separate program that can be called
from any other program that can write to the Windows directory. All you need
to do to use it is write three values to the registry, under the key HKEY_LOCAL_MACHINE\Software\HelpViewer\AppName.
You can change the registry key location in the source if you wish. The three
entries are as follows:

Type

Caption

Value

String

HelpTitle

The caption for the help window, e.g.: "My Help Window
Title"

String

HelpPath

The location of the HTML Help file, e.g. "C:\AppName\Help\file.chm"

String

index.html

The file within the HTML Help file, e.g. "index.html"

Note, the file called "index.html" must exist in the root of the
HTML Help file, as this is shown when the home button is pressed.

Then just execute the program (e.g. using ShellExecute(...)),
and the help viewer will appear. The state of the viewer (e.g. docked position)
is saved under this key as well, as a binary string. You should not edit this
directly.

Update History:

No updates yet

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

Have you tried a Gold Hound? Gold Tequila and grapefruit juice. I like mine with a splash of quinine (tonic) water. I used to enjoy them regularly, until I overheard the waitress ordering another "Silly Roger." - Roger Wright

I would like to know whether this tool works under NT without MSIE installed on the machine. In my company Netscape is the standard browser and I can for the moment not convince my MIS people to switch.

And now for something completely different
I checked in the sources and found out tha the changes under the registry should be under '.../helpviewer/webbuilder studio' in stead of under '.../helpviewer/appname'

Yes and no respectively. I'm afraid this app requires Microsoft Internet Explorer to be inststalled, even if it is not being used as a browser. If I remember correctly, the app uses the MFC class CHtmlView, which in turn uses the WebBrowser control.

Hi!
You wrote a very good program, right now I need make an MFC dialog based app that displys an HTML page inside a control... I have tried to use Your code, but I'm a beginner and I cannot understand how to make it.

I guess this is the part of Your code that I need:
m_hlpWnd.ReplaceControl(this,
IDC_HTMLCTRL, // the control we are replacing
HHCTRL_BTN_HOME | HHCTRL_BTN_BACK | HHCTRL_BTN_FORWARD | HHCTRL_BTN_PRINT,
"index.html", // where the home button should go
FALSE); // don't display button labels

m_hlpWnd.Navigate("....\\index.html");

But I'm not ablle to make it work, in order to replace the IDC_HTMLCTRL and show the index.html

but the setting of the caption's font does not work. DoDataExchange seems to be the wrong place.

I don't have this problem. I just checked by modifiying the CWBHelpDlg::DoDataExchange(...) function to use Comic Sans MS as it's font, rather than the 'SPI_GETICONTITLELOGFONT' font, and it worked fine. Maybe you could send me your modified version of CWBHelpDlg::DoDataExchange(...), then I could take a look at it. It may just be that the program only works on my machine (I didn't test it, I just 'presumed' it would work with compatible machines - always a big mistake).

Also the the underlying window gets not repainted properly, when the WBHelp folds

I'm not sure what can be done about this. I have not expierienced this problem either, and the 'folding' is done by the CAppBar class, which I didn't write. I have tried to keep out of there as much as possible, but maybe the problem lies in CAppBar::SlideWindow(...). I'm afraid I can't help if I can't reconstruct the problem .

Maybe you could send me your modified version of CWBHelpDlg::DoDataExchange(...), then I could take a look at it.

In fact it has been your original unchanged sample application . As I told, this happens often--if not everytime--I try to change a standard controls font. Perhaps you or someone else knows this misbehaviour ?!?

Also the the underlying window gets not repainted properly, when the WBHelp folds.

Ok, that seems to be a snapshot by myself. Visual Studio did not repaint the source window properly. After further testing, this issue did not occur again. Sorry for any inconvenience