Solved

Context sensitive help in CFormView

Posted on 1997-09-04
2
342 Views
Last Modified: 2013-11-20
I want to have context sensitive help in a CFormView derived class. I have added the WS_EX_CONTEXTHELP style to the dialog template, and a ID_CONTEXT_HELP button in my toolbar. When I click on it the cursor changes to a question mark, as it should.
But when I click on a control in the formview, I only get a message that the help topic does not exist.
I have a WM_HELPINFO handler in the formview where I start WinHelp with the appropriate array with controls ids and help topics, but it never gets called.
Shold the handler be somewhere else, or am I doing something else wrong? Some pointers would be greatly appreciated.
0
Comment
Question by:rj2
2 Comments
 
LVL 1

Accepted Solution

by:
cnasarre earned 100 total points
Comment Utility
I have added a context help in a CFormView with a message handler for WM_HELPHITTEST


BEGIN_MESSAGE_MAP(CHelpView, CFormView)
   ON_MESSAGE(WM_HELPHITTEST, OnHelpHitTest)
END_MESSAGE_MAP()


LRESULT CHelpView::OnHelpHitTest(WPARAM wParam, LPARAM lParam)
{
   TRACE("CHelpView::OnHelpHitTest(%u, %u)\n", wParam, lParam);

// return the index of the help topic to display
// --> here it is HIDD_ABOUTBOX from the HLP\xxx.hm file
   return(0x20064);
}

0
 
LVL 10

Author Comment

by:rj2
Comment Utility
It worked. Thanks.
The help comes in a normal help window, but I want a popup window instead. I was able to do that by overriding CWinApp::WinHelp, but I guess it would be cleaner to implement it in the particular frame instead. Is there a clean way to do that?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

10 Experts available now in Live!

Get 1:1 Help Now