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.

109 lines
3.2 KiB

  1. // PropPageGeneral.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "emshell.h"
  5. #include "PropPageGeneral.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CPropPageGeneral property page
  13. IMPLEMENT_DYNCREATE(CPropPageGeneral, CPropertyPage)
  14. CPropPageGeneral::CPropPageGeneral() : CPropertyPage(CPropPageGeneral::IDD)
  15. {
  16. //{{AFX_DATA_INIT(CPropPageGeneral)
  17. m_strdwBucket1 = _T("");
  18. m_strName = _T("");
  19. m_strszBucket1 = _T("");
  20. m_strGUID = _T("");
  21. m_strHR = _T("");
  22. m_strPID = _T("");
  23. m_strType = _T("");
  24. m_strEndDate = _T("");
  25. m_strStartDate = _T("");
  26. m_strStatus = _T("");
  27. //}}AFX_DATA_INIT
  28. }
  29. CPropPageGeneral::~CPropPageGeneral()
  30. {
  31. }
  32. void CPropPageGeneral::DoDataExchange(CDataExchange* pDX)
  33. {
  34. CPropertyPage::DoDataExchange(pDX);
  35. //{{AFX_DATA_MAP(CPropPageGeneral)
  36. DDX_Control(pDX, IDC_STATIC_HRLABEL, m_ctrlHRLabel);
  37. DDX_Control(pDX, IDC_STATIC_SZBUCKET1LABEL, m_ctrlszBucket1Label);
  38. DDX_Control(pDX, IDC_STATIC_DWBUCKET1LABEL, m_ctrldwBucket1Label);
  39. DDX_Control(pDX, IDC_STATIC_GUIDLABEL, m_ctrlGUIDLabel);
  40. DDX_Text(pDX, IDC_STATIC_DWBUCKET1VAL, m_strdwBucket1);
  41. DDX_Text(pDX, IDC_STATIC_NAMEVAL, m_strName);
  42. DDX_Text(pDX, IDC_STATIC_SZBUCKET1VAL, m_strszBucket1);
  43. DDX_Text(pDX, IDC_STATIC_GUIDVAL, m_strGUID);
  44. DDX_Text(pDX, IDC_STATIC_HRVAL, m_strHR);
  45. DDX_Text(pDX, IDC_STATIC_PIDVAL, m_strPID);
  46. DDX_Text(pDX, IDC_STATIC_TYPEVAL, m_strType);
  47. DDX_Text(pDX, IDC_STATIC_ENDDATEVAL, m_strEndDate);
  48. DDX_Text(pDX, IDC_STATIC_STARTDATEVAL, m_strStartDate);
  49. DDX_Text(pDX, IDC_STATIC_STATUSVAL, m_strStatus);
  50. //}}AFX_DATA_MAP
  51. }
  52. BEGIN_MESSAGE_MAP(CPropPageGeneral, CPropertyPage)
  53. //{{AFX_MSG_MAP(CPropPageGeneral)
  54. //}}AFX_MSG_MAP
  55. END_MESSAGE_MAP()
  56. /////////////////////////////////////////////////////////////////////////////
  57. // CPropPageGeneral message handlers
  58. BOOL CPropPageGeneral::OnInitDialog()
  59. {
  60. CPropertyPage::OnInitDialog();
  61. COleDateTime startDate((DATE)m_pEmObject->dateStart);
  62. COleDateTime endDate((DATE)m_pEmObject->dateEnd);
  63. // TODO: Add extra initialization here
  64. m_strEndDate = endDate.Format(L"%c");
  65. m_strStartDate = startDate.Format(L"%c");
  66. m_strPID.Format(L"%d", m_pEmObject->nId);
  67. //Display status string
  68. ((CEmshellApp*)AfxGetApp())->GetStatusString(m_pEmObject->nStatus, m_strStatus);
  69. m_strName = m_pEmObject->szName;
  70. //Map the process type to a string and populate
  71. ((CEmshellApp*)AfxGetApp())->GetEmObjectTypeString(m_pEmObject->type, m_strType);
  72. #ifdef _DEBUG
  73. const cchMax = 128;
  74. TCHAR szGuid[cchMax + 1];
  75. GUID guid = *((GUID*) m_pEmObject->guidstream);
  76. StringFromGUID2 ( guid, szGuid, cchMax );
  77. m_strGUID.Format(L"%s", szGuid);
  78. m_strszBucket1.Format(L"%s", m_pEmObject->szBucket1);
  79. m_strdwBucket1.Format(L"%d", m_pEmObject->dwBucket1);
  80. m_strHR.Format(L"0x%x", m_pEmObject->hr);
  81. #endif
  82. #ifndef _DEBUG
  83. //Set unwanted string text to null
  84. m_ctrlszBucket1Label.SetWindowText(_T(""));
  85. m_ctrlGUIDLabel.SetWindowText(_T(""));
  86. m_ctrldwBucket1Label.SetWindowText(_T(""));
  87. m_ctrlHRLabel.SetWindowText(_T(""));
  88. #endif
  89. UpdateData(FALSE);
  90. return TRUE; // return TRUE unless you set the focus to a control
  91. // EXCEPTION: OCX Property Pages should return FALSE
  92. }