Getting F1 help to work in existing MFC application

Posted on 2009-02-19
Last Modified: 2013-12-14
I have an existing application that I am trying to add context sensitive help to. I have added in the appropriate class/functions as detailed in the MSDN article about adding help to an existing app. I do have the help menu hooked up so that when I select help the help window pops up and I can see my help info (I used WinHelp to build it). My problem is that I can't figure out how to hook a dialog or control to the help so when  you press F1 you get the specific help topic. I have read that you need to prepend the desired item's ID with an H (do IDD_BUTTON1 would be HIDD_BUTTON1) but I can't figure out how to make that work. I have it changed in the help file but it apparently does not know how to map it in C. I am a C/MFC novice, so please explain how to make this work in detail. Also, eventually I will need to change the mechanism to be a different key than F1, so how do that would be helpful too.
Question by:jadixon
    LVL 19

    Accepted Solution

    I am not certain if this will be helpful however you might be interested in the following two MSDN videos:

    How Do I: Use HTML Help in MFC? Part 1

    How Do I: Use HTML Help in MFC? Part 2

    The tutorial videos have a segment about context sensitive help however they are for HTML help and not WinHelp which you mentioned. WinHelp is actually an obsolete format and as of Vista is no longer included out-of-the-box according to so you might consider switching.

    Author Closing Comment

    I have not viewed these videos due to time constraints.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now