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.

188 lines
4.9 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1996 Microsoft Corporation
  4. //
  5. // Module Name:
  6. // About.cpp
  7. //
  8. // Abstract:
  9. // Implementation of the CAboutDlg class.
  10. //
  11. // Author:
  12. // David Potter (davidp) October 11, 1996
  13. //
  14. // Revision History:
  15. //
  16. // Notes:
  17. //
  18. /////////////////////////////////////////////////////////////////////////////
  19. #include "stdafx.h"
  20. #include "CluAdmin.h"
  21. #include "About.h"
  22. #include "VerInfo.h"
  23. #ifdef _DEBUG
  24. #define new DEBUG_NEW
  25. #undef THIS_FILE
  26. static char THIS_FILE[] = __FILE__;
  27. #endif
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CAboutDlg
  30. /////////////////////////////////////////////////////////////////////////////
  31. /////////////////////////////////////////////////////////////////////////////
  32. // Message Maps
  33. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  34. //{{AFX_MSG_MAP(CAboutDlg)
  35. //}}AFX_MSG_MAP
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. //++
  39. //
  40. // CAboutDlg::CAboutDlg
  41. //
  42. // Routine Description:
  43. // Default constructor.
  44. //
  45. // Arguments:
  46. // None.
  47. //
  48. // Return Value:
  49. // None.
  50. //
  51. //--
  52. /////////////////////////////////////////////////////////////////////////////
  53. CAboutDlg::CAboutDlg(void) : CDialog(CAboutDlg::IDD)
  54. {
  55. //{{AFX_DATA_INIT(CAboutDlg)
  56. m_strWarning = _T("");
  57. m_strProductTitle = _T("");
  58. m_strFileTitle = _T("");
  59. m_strVersion = _T("");
  60. m_strCopyright = _T("");
  61. //}}AFX_DATA_INIT
  62. } //*** CAboutDlg::CAboutDlg()
  63. /////////////////////////////////////////////////////////////////////////////
  64. //++
  65. //
  66. // CAboutDlg::DoDataExchange
  67. //
  68. // Routine Description:
  69. // Do data exchange between the dialog and the class.
  70. //
  71. // Arguments:
  72. // pDX [IN OUT] Data exchange object
  73. //
  74. // Return Value:
  75. // None.
  76. //
  77. //--
  78. /////////////////////////////////////////////////////////////////////////////
  79. void CAboutDlg::DoDataExchange(CDataExchange * pDX)
  80. {
  81. CDialog::DoDataExchange(pDX);
  82. //{{AFX_DATA_MAP(CAboutDlg)
  83. DDX_Control(pDX, IDC_ABOUT_ICON, m_staticIcon);
  84. DDX_Control(pDX, IDC_ABOUT_VERSION, m_staticVersion);
  85. DDX_Control(pDX, IDC_ABOUT_FILE_TITLE, m_staticFileTitle);
  86. DDX_Control(pDX, IDC_ABOUT_PRODUCT_TITLE, m_staticProductTitle);
  87. DDX_Control(pDX, IDC_ABOUT_WARNING, m_staticWarning);
  88. DDX_Control(pDX, IDC_ABOUT_COPYRIGHT, m_staticCopyright);
  89. DDX_Text(pDX, IDC_ABOUT_WARNING, m_strWarning);
  90. DDX_Text(pDX, IDC_ABOUT_PRODUCT_TITLE, m_strProductTitle);
  91. DDX_Text(pDX, IDC_ABOUT_FILE_TITLE, m_strFileTitle);
  92. DDX_Text(pDX, IDC_ABOUT_VERSION, m_strVersion);
  93. DDX_Text(pDX, IDC_ABOUT_COPYRIGHT, m_strCopyright);
  94. //}}AFX_DATA_MAP
  95. } //*** CAboutDlg::DoDataExchange()
  96. /////////////////////////////////////////////////////////////////////////////
  97. //++
  98. //
  99. // CAboutDlg::OnInitDialog
  100. //
  101. // Routine Description:
  102. // Handler for the WM_INITDIALOG message.
  103. //
  104. // Arguments:
  105. // None.
  106. //
  107. // Return Value:
  108. // TRUE Focus not set yet.
  109. // FALSE Focus already set.
  110. //
  111. //--
  112. /////////////////////////////////////////////////////////////////////////////
  113. BOOL CAboutDlg::OnInitDialog(void)
  114. {
  115. // Get the version info.
  116. try
  117. {
  118. CVersionInfo verinfo;
  119. // Get the warning text.
  120. m_strWarning.LoadString(IDS_ABOUT_WARNING);
  121. // Initialize the version info.
  122. verinfo.Init();
  123. // Get strings from the version resource.
  124. m_strProductTitle = verinfo.PszQueryValue(_T("ProductName"));
  125. m_strFileTitle = verinfo.PszQueryValue(_T("FileDescription"));
  126. m_strCopyright = verinfo.PszQueryValue(_T("LegalCopyright"));
  127. // Get the version display string.
  128. verinfo.QueryFileVersionDisplayString(m_strVersion);
  129. } // try
  130. catch (...)
  131. {
  132. // Who cares if an exception is thrown. We're just displaying the about box.
  133. } // catch: anything
  134. // Call the base class method.
  135. CDialog::OnInitDialog();
  136. // Create fonts.
  137. // BCreateFont(m_fontProductTitle, 16, TRUE /*bBold*/);
  138. // BCreateFont(m_fontCopyright, 14, TRUE /*bBold*/);
  139. // BCreateFont(m_fontWarning, 4, FALSE /*bBold*/);
  140. // m_staticProductTitle.SetFont(&m_fontProductTitle, FALSE /*bRedraw*/);
  141. // m_staticFileTitle.SetFont(&m_fontProductTitle, FALSE /*bRedraw*/);
  142. // m_staticVersion.SetFont(&m_fontProductTitle, FALSE /*bRedraw*/);
  143. // m_staticCopyright.SetFont(&m_fontCopyright, FALSE /*bRedraw*/);
  144. // m_staticWarning.SetFont(&m_fontWarning, FALSE /*bRedraw*/);
  145. // Set the icon to the big cluster picture.
  146. {
  147. HICON hicon;
  148. // Create huge image list.
  149. VERIFY(m_ilImages.Create(
  150. (int) 64, // cx
  151. 64, // cy
  152. TRUE, // bMask
  153. 1, // nInitial
  154. 4 // nGrow
  155. ));
  156. m_ilImages.SetBkColor(::GetSysColor(COLOR_WINDOW));
  157. // Load the images into the large image list.
  158. CClusterAdminApp::LoadImageIntoList(&m_ilImages, IDB_CLUSTER_64);
  159. hicon = m_ilImages.ExtractIcon(0);
  160. if (hicon != NULL)
  161. m_staticIcon.SetIcon(hicon);
  162. } // Set the icon to the big cluster picture
  163. return TRUE; // return TRUE unless you set the focus to a control
  164. // EXCEPTION: OCX Property Pages should return FALSE
  165. } //*** CAboutDlg::OnInitDialog()