Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1999 - 2000
  6. //
  7. // File: dlgcshlp.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. #include "dlgcshlp.h"
  11. #include "propertypage.h"
  12. IMPLEMENT_DYNCREATE(CHelpDialog, CDialog)
  13. BEGIN_MESSAGE_MAP(CHelpDialog, CDialog)
  14. //{{AFX_MSG_MAP(CHelpDialog)
  15. ON_WM_HELPINFO()
  16. ON_WM_CONTEXTMENU()
  17. //}}AFX_MSG_MAP
  18. END_MESSAGE_MAP()
  19. void CHelpDialog::OnContextMenu(CWnd* pWnd, ::CPoint point)
  20. {
  21. if (m_pHelpTable)
  22. ::WinHelp (pWnd->m_hWnd, AfxGetApp()->m_pszHelpFilePath,
  23. HELP_CONTEXTMENU, (DWORD_PTR)(LPVOID)m_pHelpTable);
  24. }
  25. BOOL CHelpDialog::OnHelpInfo(HELPINFO* pHelpInfo)
  26. {
  27. if (pHelpInfo->iContextType == HELPINFO_WINDOW && m_pHelpTable)
  28. {
  29. ::WinHelp ((HWND)pHelpInfo->hItemHandle,
  30. AfxGetApp()->m_pszHelpFilePath,
  31. HELP_WM_HELP,
  32. (DWORD_PTR)(LPVOID)m_pHelpTable);
  33. }
  34. return TRUE;
  35. }
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CHelpPage property page
  38. BEGIN_MESSAGE_MAP(CHelpPage, CPropertyPage)
  39. //{{AFX_MSG_MAP(CHelpPage)
  40. ON_WM_HELPINFO()
  41. ON_WM_CONTEXTMENU()
  42. //}}AFX_MSG_MAP
  43. END_MESSAGE_MAP()
  44. void CHelpPage::OnContextMenu(CWnd* pWnd, CPoint point)
  45. {
  46. if (m_pHelpTable)
  47. ::WinHelp (pWnd->m_hWnd, AfxGetApp()->m_pszHelpFilePath,
  48. HELP_CONTEXTMENU, (DWORD_PTR)(LPVOID)m_pHelpTable);
  49. }
  50. BOOL CHelpPage::OnHelpInfo(HELPINFO* pHelpInfo)
  51. {
  52. if (pHelpInfo->iContextType == HELPINFO_WINDOW && m_pHelpTable)
  53. {
  54. ::WinHelp ((HWND)pHelpInfo->hItemHandle,
  55. AfxGetApp()->m_pszHelpFilePath,
  56. HELP_WM_HELP,
  57. (DWORD_PTR)(LPVOID)m_pHelpTable);
  58. }
  59. return TRUE;
  60. }
  61. /////////////////////////////////////////////////////////////////////////////
  62. // CHelpPageEx property page
  63. BEGIN_MESSAGE_MAP(CHelpPageEx, CPropertyPageEx)
  64. //{{AFX_MSG_MAP(CHelpPageEx)
  65. ON_WM_HELPINFO()
  66. ON_WM_CONTEXTMENU()
  67. //}}AFX_MSG_MAP
  68. END_MESSAGE_MAP()
  69. void CHelpPageEx::OnContextMenu(CWnd* pWnd, CPoint point)
  70. {
  71. if (m_bHelpEnabled)
  72. {
  73. if (m_pHelpTable)
  74. {
  75. ::WinHelp (pWnd->m_hWnd, AfxGetApp()->m_pszHelpFilePath,
  76. HELP_CONTEXTMENU, (DWORD_PTR)(LPVOID)m_pHelpTable);
  77. }
  78. }
  79. }
  80. BOOL CHelpPageEx::OnHelpInfo(HELPINFO* pHelpInfo)
  81. {
  82. if (m_bHelpEnabled)
  83. {
  84. if (pHelpInfo->iContextType == HELPINFO_WINDOW && m_pHelpTable)
  85. {
  86. ::WinHelp ((HWND)pHelpInfo->hItemHandle,
  87. AfxGetApp()->m_pszHelpFilePath,
  88. HELP_WM_HELP,
  89. (DWORD_PTR)(LPVOID)m_pHelpTable);
  90. }
  91. }
  92. return TRUE;
  93. }