/LeaderGenerator/LeaderGenerator/aboutdlg.cpp

http://leadersgenerator.codeplex.com · C++ · 71 lines · 59 code · 8 blank · 4 comment · 0 complexity · 84ffbf4a3f4050364ce5f565923dbe87 MD5 · raw file

  1. #include "stdafx.h"
  2. #include "aboutdlg.h"
  3. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  4. , m_sVersion(_T(""))
  5. , m_sCopyright(_T(""))
  6. {
  7. m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON_MAINFRAME);
  8. }
  9. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  10. {
  11. CDialog::DoDataExchange(pDX);
  12. DDX_Control(pDX, IDC_STATIC_ABOUT_ICON, m_StaticIcon);
  13. DDX_Text(pDX, IDC_STATIC_ABOUT_VERSION, m_sVersion);
  14. DDX_Text(pDX, IDC_STATIC_ABOUT_COPYRIGHT, m_sCopyright);
  15. DDX_Control(pDX, IDC_STATIC_ABOUT_SYSLINK1, m_Link);
  16. }
  17. BOOL CAboutDlg::OnInitDialog()
  18. {
  19. CDialog::OnInitDialog();
  20. this->SetIcon(m_hIcon,FALSE);
  21. this->SetIcon(m_hIcon,TRUE);
  22. //;
  23. m_StaticIcon.SetIcon(m_hIcon);
  24. //version;
  25. int retload = 0;
  26. CString temp;
  27. temp.Empty();
  28. retload = temp.LoadString(IDS_VERSION_MAJOR);
  29. m_sVersion.Append(temp);
  30. m_sVersion +=".";
  31. retload = temp.LoadString(IDS_VERSION_MINOR);
  32. m_sVersion.Append(temp);
  33. m_sVersion +=".";
  34. retload = temp.LoadString(IDS_VERSION_REVISION);
  35. m_sVersion.Append(temp);
  36. m_sVersion +=".";
  37. retload = temp.LoadString(IDS_VERSION_BUILD);
  38. m_sVersion.Append(temp);
  39. //copyright;
  40. temp.Empty();
  41. retload = temp.LoadString(IDS_COPYRIGHT_AUTHOR);
  42. m_sCopyright.Append(temp);
  43. m_sCopyright +=" ";
  44. retload = temp.LoadString(IDS_COPYRIGHT_UNIVERSITY);
  45. m_sCopyright.Append(temp);
  46. m_sCopyright +=" ";
  47. retload = temp.LoadString(IDS_COPYRIGHT_YEAR);
  48. m_sCopyright.Append(temp);
  49. //MailTo;
  50. retload = temp.LoadString(IDS_COPYRIGHT_EMAIL);
  51. m_Link.SetWindowTextW(_T("<a>rubost@outlook.com</a>"));
  52. UpdateData(FALSE);
  53. return TRUE;
  54. }
  55. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  56. ON_NOTIFY(NM_CLICK, IDC_STATIC_ABOUT_SYSLINK1, &CAboutDlg::OnNMClickStaticAboutSyslink1)
  57. END_MESSAGE_MAP()
  58. void CAboutDlg::OnNMClickStaticAboutSyslink1(NMHDR *pNMHDR, LRESULT *pResult)
  59. {
  60. *pResult = 0;
  61. ShellExecute(NULL,_T("open"),_T("mailto:rubost@outlook.com"),NULL,NULL,SW_NORMAL);
  62. return;
  63. }