Article ID: 167170
Article Last Modified on 11/21/2006
...
#include "resource.hm" // Make sure you include the .hm file
// generated by the resource editor.
// It includes the help ID's for the
// controls.
...
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
...
// Associate a help context id with the TestHelp control.
// IDC_TESTHELP_CONTROL is the id of the TestHelp control and
// HIDC_TESTHELP_CONTROL is its help context id defined in
// resource.hm file.
CWnd* control = GetDlgItem(IDC_TESTHELP_CONTROL);
control->SetWindowContextHelpId(HIDC_TESTHELP_CONTROL);
return TRUE; // Return TRUE unless you set the focus to a control.
// EXCEPTION: OCX Property Pages should return FALSE.
}
void CMyDialog::MyFunction()
{
// Retrieve the help context id associated with the TestHelp
// control.
CWnd* control = GetDlgItem(IDC_TESTHELP_CONTROL);
DWORD help_id = control->GetWindowContextHelpId();
TRACE("Help ID for Control IDC_TESTHELP_CONTROL : %x\n", help_id);
...
}
(c) Microsoft Corporation 1997, All Rights Reserved.
Contributions by Yeong-Kah Tam, Microsoft Corporation
Keywords: kbbug kbnoupdate kbcshelp kbcontainer kbctrl KB167170