void CCSHPropertySheet::OnContextMenu(CWnd*pWnd, CPoint pt) { m_pwndContext=WndFromPoint(this,pWnd,pt); if(NULL==m_pwndContext || !CCSHCommon::OnContextMenu(this,pt,HelpID(m_pwndContext->GetDlgCtrlID()))){ CPropertySheet::OnContextMenu(pWnd,pt); } }
BOOL CCSHPropertySheet::OnInitDialog() { CPropertySheet::OnInitDialog(); if(0==HelpID(IDOK)){ // Dynamically add/remove the question mark button to the title bar of the dialog box: ModifyStyleEx(WS_EX_CONTEXTHELP,0,0); } else { ModifyStyleEx(0,WS_EX_CONTEXTHELP,0); } if(CSHFile().IsEmpty()){ // All of the following mess happens because Microsoft decided to show a help button by // default to every Property sheet constructed by Visual C++ 6.In the following lines, // I hide the help button and move the other three buttons to where they should be. CWnd *pwndHelpButton=GetDlgItem(IDHELP); if(pwndHelpButton){ static const int _afxPropSheetButtons[] = { IDOK, IDCANCEL, ID_APPLY_NOW, IDHELP }; for (int i = 0; i < sizeof _afxPropSheetButtons/sizeof _afxPropSheetButtons[0] - 1; i++){ // Shunt button CRect rect; GetDlgItem(_afxPropSheetButtons[i+1])->GetWindowRect(&rect); ScreenToClient(&rect); GetDlgItem(_afxPropSheetButtons[i])->MoveWindow(&rect); } pwndHelpButton->DestroyWindow(); } } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
/******************************************************************************************** > HelpID TipsDlg::GetTipHelpID() Author: Colin_Barfoot (Xara Group Ltd) <*****@*****.**> Created: 03/08/96 Returns: The HelpID associated with the current tip Purpose: Allows the user to be given further information regarding the current tip. See Also: OnMoreHelp() ********************************************************************************************/ HelpID TipsDlg::GetTipHelpID() { INT32 iHashPosition = m_iHashPosition + 2; // +1 for an annoying quote marks // Convert the right hand side to a HelpID HelpID helpID = HelpID(m_strTip.ConvertToInteger(iHashPosition)); return helpID; }
BOOL CCSHDialog::OnInitDialog() { CDialog::OnInitDialog(); if(0==HelpID(IDOK)){ // Dynamically add/remove the question mark button to the title bar of the dialog box: ModifyStyleEx(WS_EX_CONTEXTHELP,0,0); } else { ModifyStyleEx(0,WS_EX_CONTEXTHELP,0); } CWnd *pHelpButton=GetDlgItem(IDHELP); if(NULL!=pHelpButton){ pHelpButton->EnableWindow(!CSHFile().IsEmpty()); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
UINT CeCosDialog::HelpID (DWORD dwCtrlID) const { return HelpID((UINT)m_lpszTemplateName,dwCtrlID); }
BOOL CCSHPropertySheet::OnHelpInfo(HELPINFO* pHelpInfo) { DisplayHelp((HWND)pHelpInfo->hItemHandle,HelpID((HWND)pHelpInfo->hItemHandle),GetInstanceHandle()); return TRUE; }
void CCSHPropertySheet::OnWhatsThis() { DisplayHelp(m_pwndContext->m_hWnd,HelpID(m_pwndContext->m_hWnd),GetInstanceHandle()); }
void CCSHDialog::OnWhatsThis() { DisplayHelp(m_pwndContext->m_hWnd,HelpID(m_pwndContext->m_hWnd),GetInstanceHandle()); }