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.

102 lines
2.7 KiB

  1. // HMGeneralPage.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "snapin.h"
  5. #include "HMGeneralPage.h"
  6. #include "FileVersion.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CHMGeneralPage property page
  14. IMPLEMENT_DYNCREATE(CHMGeneralPage, CHMPropertyPage)
  15. CHMGeneralPage::CHMGeneralPage() : CHMPropertyPage(CHMGeneralPage::IDD)
  16. {
  17. EnableAutomation();
  18. //{{AFX_DATA_INIT(CHMGeneralPage)
  19. // NOTE: the ClassWizard will add member initialization here
  20. //}}AFX_DATA_INIT
  21. m_sHelpTopic = _T("HMon21.chm::/dhmongen.htm");
  22. }
  23. CHMGeneralPage::~CHMGeneralPage()
  24. {
  25. }
  26. void CHMGeneralPage::OnFinalRelease()
  27. {
  28. // When the last reference for an automation object is released
  29. // OnFinalRelease is called. The base class will automatically
  30. // deletes the object. Add additional cleanup required for your
  31. // object before calling the base class.
  32. CHMPropertyPage::OnFinalRelease();
  33. }
  34. void CHMGeneralPage::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CHMPropertyPage::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CHMGeneralPage)
  38. // NOTE: the ClassWizard will add DDX and DDV calls here
  39. //}}AFX_DATA_MAP
  40. }
  41. BEGIN_MESSAGE_MAP(CHMGeneralPage, CHMPropertyPage)
  42. //{{AFX_MSG_MAP(CHMGeneralPage)
  43. //}}AFX_MSG_MAP
  44. END_MESSAGE_MAP()
  45. BEGIN_DISPATCH_MAP(CHMGeneralPage, CHMPropertyPage)
  46. //{{AFX_DISPATCH_MAP(CHMGeneralPage)
  47. // NOTE - the ClassWizard will add and remove mapping macros here.
  48. //}}AFX_DISPATCH_MAP
  49. END_DISPATCH_MAP()
  50. // Note: we add support for IID_IHMGeneralPage to support typesafe binding
  51. // from VBA. This IID must match the GUID that is attached to the
  52. // dispinterface in the .ODL file.
  53. // {C3F44E6B-BA00-11D2-BD76-0000F87A3912}
  54. static const IID IID_IHMGeneralPage =
  55. { 0xc3f44e6b, 0xba00, 0x11d2, { 0xbd, 0x76, 0x0, 0x0, 0xf8, 0x7a, 0x39, 0x12 } };
  56. BEGIN_INTERFACE_MAP(CHMGeneralPage, CHMPropertyPage)
  57. INTERFACE_PART(CHMGeneralPage, IID_IHMGeneralPage, Dispatch)
  58. END_INTERFACE_MAP()
  59. /////////////////////////////////////////////////////////////////////////////
  60. // CHMGeneralPage message handlers
  61. BOOL CHMGeneralPage::OnInitDialog()
  62. {
  63. CHMPropertyPage::OnInitDialog();
  64. TCHAR szFileName[_MAX_PATH];
  65. GetModuleFileName(AfxGetInstanceHandle(),szFileName,_MAX_PATH);
  66. CFileVersion fv;
  67. fv.Open(szFileName);
  68. CString sDescription;
  69. sDescription += _T("\r\n");
  70. sDescription += fv.GetFileDescription();
  71. sDescription += _T(" Version ");
  72. sDescription += fv.GetFileVersion();
  73. sDescription += _T("\r\n");
  74. sDescription += fv.GetLegalCopyright();
  75. GetDlgItem(IDC_STATIC_INFO)->SetWindowText(sDescription);
  76. return TRUE; // return TRUE unless you set the focus to a control
  77. // EXCEPTION: OCX Property Pages should return FALSE
  78. }