Leaked source code of windows server 2003
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.

159 lines
4.3 KiB

  1. // chicdial.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12. #include "stdafx.h"
  13. #include "fixhelp.h"
  14. #ifdef _DEBUG
  15. #undef THIS_FILE
  16. static char BASED_CODE THIS_FILE[] = __FILE__;
  17. #endif
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CCSDialog dialog
  20. CCSDialog::CCSDialog(UINT nIDTemplate, CWnd* pParentWnd)
  21. : CDialog(nIDTemplate, pParentWnd)
  22. {
  23. }
  24. CCSDialog::CCSDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
  25. : CDialog(lpszTemplateName, pParentWnd)
  26. {
  27. }
  28. CCSDialog::CCSDialog() : CDialog()
  29. {
  30. }
  31. BEGIN_MESSAGE_MAP(CCSDialog, CDialog)
  32. //{{AFX_MSG_MAP(CCSDialog)
  33. //}}AFX_MSG_MAP
  34. ON_MESSAGE(WM_HELP, OnHelp)
  35. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CCSDialog message handlers
  39. LONG CCSDialog::OnHelp(WPARAM, LPARAM lParam)
  40. {
  41. ::WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, AfxGetApp()->m_pszHelpFilePath,
  42. HELP_WM_HELP, (DWORD_PTR)GetHelpIDs());
  43. return 0;
  44. }
  45. LONG CCSDialog::OnHelpContextMenu(WPARAM wParam, LPARAM)
  46. {
  47. ::WinHelp((HWND)wParam, AfxGetApp()->m_pszHelpFilePath,
  48. HELP_CONTEXTMENU, (DWORD_PTR)GetHelpIDs());
  49. return 0;
  50. }
  51. BOOL CCSDialog::OnInitDialog()
  52. {
  53. CDialog::OnInitDialog();
  54. ModifyStyleEx(0, WS_EX_CONTEXTHELP);
  55. FixHelp(this, FALSE) ;
  56. return TRUE; // return TRUE unless you set the focus to a control
  57. // EXCEPTION: OCX Property Pages should return FALSE
  58. }
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CCSPropertyPage
  61. CCSPropertyPage::CCSPropertyPage(UINT nIDTemplate, UINT nIDCaption)
  62. : CPropertyPage(nIDTemplate, nIDCaption)
  63. {
  64. m_psp.dwFlags &= ~PSP_HASHELP;
  65. }
  66. CCSPropertyPage::CCSPropertyPage(LPCTSTR lpszTemplateName,
  67. UINT nIDCaption) : CPropertyPage(lpszTemplateName, nIDCaption)
  68. {
  69. m_psp.dwFlags &= ~PSP_HASHELP;
  70. }
  71. BEGIN_MESSAGE_MAP(CCSPropertyPage, CPropertyPage)
  72. //{{AFX_MSG_MAP(CCSPropertyPage)
  73. //}}AFX_MSG_MAP
  74. ON_MESSAGE(WM_HELP, OnHelp)
  75. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  76. END_MESSAGE_MAP()
  77. /////////////////////////////////////////////////////////////////////////////
  78. // CCSPropertyPage message handlers
  79. LONG CCSPropertyPage::OnHelp(WPARAM, LPARAM lParam)
  80. {
  81. ::WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, AfxGetApp()->m_pszHelpFilePath,
  82. HELP_WM_HELP, (DWORD_PTR)GetHelpIDs());
  83. return 0;
  84. }
  85. LONG CCSPropertyPage::OnHelpContextMenu(WPARAM wParam, LPARAM)
  86. {
  87. ::WinHelp((HWND)wParam, AfxGetApp()->m_pszHelpFilePath,
  88. HELP_CONTEXTMENU, (DWORD_PTR)GetHelpIDs());
  89. return 0;
  90. }
  91. /////////////////////////////////////////////////////////////////////////////
  92. // CCSPropertySheet
  93. BEGIN_MESSAGE_MAP(CCSPropertySheet, CPropertySheet)
  94. //{{AFX_MSG_MAP(CCSPropertySheet)
  95. //}}AFX_MSG_MAP
  96. ON_WM_NCCREATE()
  97. ON_MESSAGE(WM_HELP, OnHelp)
  98. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  99. END_MESSAGE_MAP()
  100. CCSPropertySheet::CCSPropertySheet(UINT nIDCaption, CWnd *pParentWnd,
  101. UINT iSelectPage) : CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
  102. {
  103. m_psh.dwFlags &= ~PSH_HASHELP;
  104. }
  105. CCSPropertySheet::CCSPropertySheet(LPCTSTR pszCaption, CWnd *pParentWnd,
  106. UINT iSelectPage) : CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  107. {
  108. m_psh.dwFlags &= ~PSH_HASHELP;
  109. }
  110. /////////////////////////////////////////////////////////////////////////////
  111. // CCSPropertySheet message handlers
  112. LONG CCSPropertySheet::OnHelp(WPARAM wParam, LPARAM lParam)
  113. {
  114. GetActivePage()->SendMessage(WM_HELP, wParam, lParam);
  115. return 0;
  116. }
  117. LONG CCSPropertySheet::OnHelpContextMenu(WPARAM wParam, LPARAM lParam)
  118. {
  119. GetActivePage()->SendMessage(WM_CONTEXTMENU, wParam, lParam);
  120. return 0;
  121. }
  122. BOOL CCSPropertySheet::PreCreateWindow(CREATESTRUCT& cs)
  123. {
  124. cs.dwExStyle |= WS_EX_CONTEXTHELP;
  125. return CPropertySheet::PreCreateWindow(cs);
  126. }
  127. BOOL CCSPropertySheet::OnNcCreate(LPCREATESTRUCT)
  128. {
  129. return (BOOL)Default() ;
  130. }