CHICDIAL.CPP
上传用户:aakk678
上传日期:2022-07-09
资源大小:406k
文件大小:4k
源码类别:

界面编程

开发平台:

Visual C++

  1. // chicdial.cpp : implementation file
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1997 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. #ifdef _DEBUG
  14. #undef THIS_FILE
  15. static char BASED_CODE THIS_FILE[] = __FILE__;
  16. #endif
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CCSDialog dialog
  19. CCSDialog::CCSDialog(UINT nIDTemplate, CWnd* pParentWnd)
  20. : CDialog(nIDTemplate, pParentWnd)
  21. {
  22. }
  23. CCSDialog::CCSDialog(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
  24. : CDialog(lpszTemplateName, pParentWnd)
  25. {
  26. }
  27. CCSDialog::CCSDialog() : CDialog()
  28. {
  29. }
  30. BEGIN_MESSAGE_MAP(CCSDialog, CDialog)
  31. //{{AFX_MSG_MAP(CCSDialog)
  32. //}}AFX_MSG_MAP
  33. ON_MESSAGE(WM_HELP, OnHelp)
  34. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  35. END_MESSAGE_MAP()
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CCSDialog message handlers
  38. LONG CCSDialog::OnHelp(UINT, LONG lParam)
  39. {
  40. ::WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, AfxGetApp()->m_pszHelpFilePath,
  41. HELP_WM_HELP, (DWORD)(LPVOID)GetHelpIDs());
  42. return 0;
  43. }
  44. LONG CCSDialog::OnHelpContextMenu(UINT wParam, LONG)
  45. {
  46. ::WinHelp((HWND)wParam, AfxGetApp()->m_pszHelpFilePath,
  47. HELP_CONTEXTMENU, (DWORD)(LPVOID)GetHelpIDs());
  48. return 0;
  49. }
  50. BOOL CCSDialog::OnInitDialog() 
  51. {
  52. CDialog::OnInitDialog();
  53. ModifyStyleEx(0, WS_EX_CONTEXTHELP);
  54. return TRUE;  // return TRUE unless you set the focus to a control
  55.               // EXCEPTION: OCX Property Pages should return FALSE
  56. }
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CCSPropertyPage
  59. CCSPropertyPage::CCSPropertyPage(UINT nIDTemplate, UINT nIDCaption)
  60. : CPropertyPage(nIDTemplate, nIDCaption)
  61. {
  62. }
  63. CCSPropertyPage::CCSPropertyPage(LPCTSTR lpszTemplateName, 
  64. UINT nIDCaption) : CPropertyPage(lpszTemplateName, nIDCaption)
  65. {
  66. }
  67. BEGIN_MESSAGE_MAP(CCSPropertyPage, CPropertyPage)
  68. //{{AFX_MSG_MAP(CCSPropertyPage)
  69. //}}AFX_MSG_MAP
  70. ON_MESSAGE(WM_HELP, OnHelp)
  71. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  72. END_MESSAGE_MAP()
  73. /////////////////////////////////////////////////////////////////////////////
  74. // CCSPropertyPage message handlers
  75. LONG CCSPropertyPage::OnHelp(UINT, LONG lParam)
  76. {
  77. ::WinHelp( (HWND)((LPHELPINFO)lParam)->hItemHandle, AfxGetApp()->m_pszHelpFilePath,
  78. HELP_WM_HELP, (DWORD)(LPVOID)GetHelpIDs());
  79. return 0;
  80. }
  81. LONG CCSPropertyPage::OnHelpContextMenu(UINT wParam, LONG)
  82. {
  83. ::WinHelp((HWND)wParam, AfxGetApp()->m_pszHelpFilePath,
  84. HELP_CONTEXTMENU, (DWORD)(LPVOID)GetHelpIDs());
  85. return 0;
  86. }
  87. /////////////////////////////////////////////////////////////////////////////
  88. // CCSPropertySheet
  89. BEGIN_MESSAGE_MAP(CCSPropertySheet, CPropertySheet)
  90. //{{AFX_MSG_MAP(CCSPropertySheet)
  91. //}}AFX_MSG_MAP
  92. ON_MESSAGE(WM_HELP, OnHelp)
  93. ON_MESSAGE(WM_CONTEXTMENU, OnHelpContextMenu)
  94. END_MESSAGE_MAP()
  95. CCSPropertySheet::CCSPropertySheet(UINT nIDCaption, CWnd *pParentWnd, 
  96. UINT iSelectPage) : CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
  97. {
  98. }
  99. CCSPropertySheet::CCSPropertySheet(LPCTSTR pszCaption, CWnd *pParentWnd, 
  100. UINT iSelectPage) : CPropertySheet(pszCaption, pParentWnd, iSelectPage)
  101. {
  102. }
  103. /////////////////////////////////////////////////////////////////////////////
  104. // CCSPropertySheet message handlers
  105. LONG CCSPropertySheet::OnHelp(UINT wParam, LONG lParam)
  106. {
  107. GetActivePage()->SendMessage(WM_HELP, wParam, lParam);
  108. return 0;
  109. }
  110. LONG CCSPropertySheet::OnHelpContextMenu(UINT wParam, LONG lParam)
  111. {
  112. GetActivePage()->SendMessage(WM_CONTEXTMENU, wParam, lParam);
  113. return 0;
  114. }
  115. BOOL CCSPropertySheet::PreCreateWindow(CREATESTRUCT& cs)
  116. {
  117. cs.dwExStyle |= WS_EX_CONTEXTHELP;
  118. return CPropertySheet::PreCreateWindow(cs);
  119. }