Link to home
Start Free TrialLog in
Avatar of LearningCpp
LearningCpp

asked on

How can i catch the help button "?" message in a MFC dialog

Hi,

After googling all day, I thought i would post it here.
I have a MFC application in which i want to integrate a compiled help file.
with few links i could do it.
however on a CDialog-derived dialog, when I add Context help i am able to see "?" in the title.
when i click on ?, the cursor will have a ? and only when i click on a control my OnHelpInfo function is called.
What i want is:- when user clicks ont the "?" button, I want to directly open the chm file.

I cant seem to find a function where i can call htmlhelp.
I have tried OnHelp() but that will only be called when F1 is pressed, but not when ? is clicked.

Can anyone tell me how can i do this?
ASKER CERTIFIED SOLUTION
Avatar of Zoppo
Zoppo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>>>> only be called when F1 is pressed, but not when ? is clicked.
The ? minibutton is a context help which was supposed to give help for an item like an edit field or list control where the user clicked on using the ? cursor.

You could integrate the normal help into a help menu by adding a menu item with the ID_HELP id. You also could add a new minibutton for the standard help by enhancing the toolbar buttons in CMainFrame class. Check the mainframe.cpp for that.
Avatar of LearningCpp
LearningCpp

ASKER

Zoppo,
perfect....
Experts Rock!!
I concur  with itsme... The [?] button is a U/I device that has a specific purpose:  context-sensitive help for individual U/I elements on a form.   I'd never use it as a way to get general help, any more than I'd change the meaning the the [x] button to mean "delete the last thing I typed" or "turn the window green."   One should not confuse the user by making novel use of system-defined U/I elements.