user1961169
user1961169

Reputation: 799

How can I add a context sensitive help button for a specific dialog control

I have an MFC app (10 year old app), which has context sensitive help for each dialog. I want to add help on a specific combobox, as well as a little question mark button next to this control. Users can either select the combobox and hit F1, or they can click on the button next to the combobox, and it will jump to a help page that is specifically about this combobox, rather than general help for the whole dialog.

Yet selecting the combobox and pressing F1 still brings up mydialog_help.htm, instead of mycombobox.htm.

  1. What am I missing to use a separate help page for the control?
  2. Is it possible to redirect the control to an anchor in the main page? Something, along the lines of... HIDC_MYCOMBOBOX = mydialog_help.htm#mycombobox
  3. I have added a "?" button to run the following code, but this also doesn't give the context for the control, and just opens the mydialog_help.htm.

    HELPINFO    lhelpinfo;
    
    lhelpinfo.cbSize = sizeof(lhelpinfo);
    lhelpinfo.iContextType = HELPINFO_WINDOW;
    lhelpinfo.iCtrlId = IDC_BALANCING_METHOD;
    lhelpinfo.hItemHandle = GetDlgItem(IDC_BALANCING_METHOD)->m_hWnd;
    lhelpinfo.dwContextId = HIDC_BALANCING_METHOD;
    lhelpinfo.MousePos = POINT();
    
    CDialog::OnHelpInfo(&lhelpinfo);
    

Upvotes: 0

Views: 657

Answers (0)

Related Questions