Click here to Skip to main content
13,351,985 members (72,304 online)
Click here to Skip to main content
Add your own
alternative version


28 bookmarked
Posted 10 Jun 2001

Simple RTF based Help Dialog

, 3 Oct 2001
Rate this:
Please Sign up or sign in to vote.
Yet Another Simple Help Dialog
<!-- Download Links --> <!-- Article image -->

Sample Image - MyHelpDialog.jpg

<!-- Main HTML starts here -->


This Rich Text based Help Dialog is a quick and easy way of adding on-line help to your applications. For some applications its just too much work to build a complete help system, but its sufficient to display some guide lines. This dialog has the "looks and feel" of the real thing.


  • Standard Help Window look and feel
  • Auto size of window to fit RTF text
  • Resizable
  • Auto scrollbars in case window is resized too small to fit complete RTF text
  • Copy and Print via context menu
  • Can load RTF from resource OR from file on disk

How to add this class to your project

The steps to include this dialog into your project are:

  1. Add the HelpDialog.cpp and HelpDialog.h files to your project
  2. Copy and Paste the following Help Dialog resources from the demo project resources into your project:
    • IDD_HELP_DIALOG dialog
    • IDI_HELP_ICON icon
  3. Add a Help button or menu to your project (see sample project)

The Rich Text Format (RTF) contents of the help message can best be created using Wordpad. I have tried Word as well, but the resulting RTF format is sometimes too elaborate to be used in the Rich Edit control. You can tell if your RTF it too elaborate, because if that is the case the Help Dialog will not show any message at all ;-)

The RTF can be loaded in two different methods, the first is to import the RTF file into the resources of your project. The 2nd method is to load the RTF file from disk at runtime. Select the method that fits your needs best. The demo project shows both methods.

#include "HelpDialog.h"
// Example using the class from RTF resource
	CHelpDialog hlp(this, IDR_HELP); 	// create Help Dialog using RTF resource
	hlp.SetTitle( "Simple Help Demo" ); 	// set a title (optional)
	hlp.DoModal(); 			// pop it up

The next code show how to load the help message from a file on disk:

#include "HelpDialog.h"
// Example loading RTF from disk
	CHelpDialog hlp(this); 		// create Help Dialog
	hlp.SetTitle( "Simple Help Demo" ); 	// set a title (optional)
	hlp.LoadRTFFile( "Help2.rtf" );	// load the RTF from file
	hlp.DoModal(); 			// pop it up

The demo project also shows (see both Help menu items) how to use the dialog in modeless mode. Although a little bit more work is required, this is the preferred method. With a modeless help dialog, the user can switch to the application and refer to the help dialog at the same time. With the modal approach, as in the samples above, the help dialog must be closed first before the application window can be accessed.

Final notes

This article was inspired by the TCX Message Box By Thales P. Carvalho and in fact I used his dialog class at first for my help messages. Later I felt the need to make it look more like a real help message, hence this class. And yes, I know there's the real help system out there, but the steps involved in building a real help file (RTF file, Help ID's, Help Compiler, etc.) are sometimes simply too much work.


4 Oct 2001 - fix for the detected streamin bug.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Antoine Megens
Software Developer (Senior)
Netherlands Netherlands
I've been in touch with computers since 1979 when I bought my OSI Superboard. Self taught men ever since, learned C programming on a VAX, learned MFC for a nice Space related project.
Later came into contact with C#/.NET and reached MCAD level in 2007 (now expired).

I'm currently employed by a small engineering firm in the Netherlands, where I live.

You may also be interested in...


Comments and Discussions

QuestionHow to Load Image?? Pin
xdchen2620-Feb-14 20:11
memberxdchen2620-Feb-14 20:11 
AnswerRe: How to Load Image?? Pin
Antoine Megens20-Feb-14 23:07
memberAntoine Megens20-Feb-14 23:07 
QuestionCallback routine incorrect for unicode Pin
Member 949563210-Oct-13 14:29
memberMember 949563210-Oct-13 14:29 
Questionhow to go set and use a bookmark ?? Pin
xiaocong00421-Feb-12 19:15
memberxiaocong00421-Feb-12 19:15 
AnswerRe: how to go set and use a bookmark ?? Pin
Antoine Megens22-Feb-12 1:24
memberAntoine Megens22-Feb-12 1:24 
GeneralRe: how to go set and use a bookmark ?? Pin
xiaocong00422-Feb-12 2:44
memberxiaocong00422-Feb-12 2:44 
QuestionRTF Image support [modified] Pin
bethgocs18-Jun-06 2:12
memberbethgocs18-Jun-06 2:12 
AnswerRe: RTF Image support [modified] Pin
Antoine Megens18-Jun-06 22:31
memberAntoine Megens18-Jun-06 22:31 
GeneralWindow is not Updated Pin
azghar6-Oct-03 3:18
memberazghar6-Oct-03 3:18 
Thanks for your application. Nice Technique. One thing I am afraid of is "Window is not redrawn". Yes I checked the Dialog Box Maximize Property and I started maximizing the Dialog Box. After Maxmizing I started to use Vertical Scroll bars. While using Vertical Scroll bar Dialog Box should update it self. But it is not updating Properly. I think we have to use UpdateWindow() member function. I don't where we have to use it.
Thanks in Advance.

GeneralRe: Window is not Updated Pin
Antoine Megens6-Oct-03 4:04
memberAntoine Megens6-Oct-03 4:04 
GeneralRe: Window is not Updated Pin
Azghar6-Oct-03 5:21
memberAzghar6-Oct-03 5:21 
GeneralRe: Window is not Updated Pin
Antoine Megens6-Oct-03 5:52
memberAntoine Megens6-Oct-03 5:52 
General[Message Removed] Pin
immetoz4-Oct-08 16:12
memberimmetoz4-Oct-08 16:12 
Questionwindow too big? Pin
Antoine Megens13-Jun-02 0:15
memberAntoine Megens13-Jun-02 0:15 
Generala bug Pin
dragonred10-Sep-01 16:30
memberdragonred10-Sep-01 16:30 
GeneralRe: a bug Pin
Antoine Megens3-Oct-01 4:27
memberAntoine Megens3-Oct-01 4:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180111.1 | Last Updated 4 Oct 2001
Article Copyright 2001 by Antoine Megens
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid