Apply help to wizard base project

Hi Experts,

 I am creating a wizard base application using CPropertysheet and CPropertypage.
This application is working fine for me.
Now I want to implement my help file ( wizard.chm) on the clicking of it'e default HELP button.
I am not able to find the appropriate place to write code for help file displaying.

Can any on help me

Who is Participating?
You may add a command handler for the help button, like this


BEGIN_MESSAGE_MAP(CPageWithHelp, CPropertyPage)

void CPageWithHelp::OnHelp()
HtmlHelp(NULL, _T("C:\\testhelp.chm"), HH_DISPLAY_TOPIC, 0);

This should enable the help button on activating the property page.

The HtmlHelp function call requires:
#include "Htmlhelp.h"

and in the project settings, tab "link", entry "object/library modules":htmlhelp.lib

See knowledge base article:
HOWTO: Set Up Visual C++ to Use the HTML Help API

For how to produce compiled html (".chm") files. You may check the page:

Ralf KlattEmployee in Civil ServiceCommented:

I'd suggest to have a look at this project:

... it has a good rating and I hope it's what you're looking for!

Best regards,
AndyAinscowFreelance programmer / ConsultantCommented:
>>clicking of it'e default HELP button.

You shouldn't need to write any code - the default handler ought to start the 'chm' file for the application
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

davinder101Author Commented:
Hi Mahesh,
Thanks , This code really works  , and now i am able to open the help file by clicking the Help button. But still Help shotcut Key "F1" is not able to show the help file. It is showing the error message.

well then may be I think you need to trap WM_HELPINFO message and then you may send WM_HELP to your active property page or may invoke your html help directly....

something like

BOOL CTreePropSheetEx::OnHelpInfo(HELPINFO* pHelpInfo)
  CPropertyPage* page = GetActivePage();
  if( page != NULL )
    page->SendMessage(WM_HELP, 0, reinterpret_cast<LPARAM>(pHelpInfo) );

  return TRUE;

Just try by handling WM_HELPINFO something like this way and check if it works with F1....

Forced accept.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.