Leaked source code of windows server 2003
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.

113 lines
2.6 KiB

  1. // MessagePropertyPg.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #define __FILE_ID__ 58
  5. #ifdef _DEBUG
  6. #define new DEBUG_NEW
  7. #undef THIS_FILE
  8. static char THIS_FILE[] = __FILE__;
  9. #endif
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CMessagePropertyPg property page
  12. IMPLEMENT_DYNCREATE(CMsgPropertyPg, CFaxClientPg)
  13. CMsgPropertyPg::CMsgPropertyPg(
  14. DWORD dwResId, // dialog resource id
  15. CFaxMsg* pMsg // pointer to CArchiveMsg/CJob
  16. ):
  17. CFaxClientPg(dwResId),
  18. m_pMsg(pMsg)
  19. {
  20. }
  21. CMsgPropertyPg::~CMsgPropertyPg()
  22. {
  23. }
  24. void CMsgPropertyPg::DoDataExchange(CDataExchange* pDX)
  25. {
  26. CFaxClientPg::DoDataExchange(pDX);
  27. //{{AFX_DATA_MAP(CMessagePropertyPg)
  28. // NOTE: the ClassWizard will add DDX and DDV calls here
  29. //}}AFX_DATA_MAP
  30. }
  31. BEGIN_MESSAGE_MAP(CMsgPropertyPg, CFaxClientPg)
  32. //{{AFX_MSG_MAP(CMessagePropertyPg)
  33. //}}AFX_MSG_MAP
  34. END_MESSAGE_MAP()
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CMessagePropertyPg message handlers
  37. void
  38. CMsgPropertyPg::Refresh(
  39. TMsgPageInfo* pPageInfo, // page info array
  40. DWORD dwSize // size of the array
  41. )
  42. {
  43. DWORD dwRes = ERROR_SUCCESS;
  44. DBG_ENTER(TEXT("CMessagePropertyPg::Refresh"));
  45. CFaxClientPg::OnInitDialog();
  46. CItemPropSheet* pParent = (CItemPropSheet*)GetParent();
  47. //
  48. // create CArchiveMsg adapter
  49. //
  50. CViewRow messView;
  51. dwRes = messView.AttachToMsg(m_pMsg);
  52. if (ERROR_SUCCESS != dwRes)
  53. {
  54. CALL_FAIL (GENERAL_ERR, TEXT("CViewRow::AttachToMsg"), dwRes);
  55. pParent->SetLastError(ERROR_INVALID_DATA);
  56. pParent->EndDialog(IDABORT);
  57. return;
  58. }
  59. CWnd *pWnd;
  60. for(DWORD dw=0; dw < dwSize; ++dw)
  61. {
  62. //
  63. // set item value
  64. //
  65. pWnd = GetDlgItem(pPageInfo[dw].dwValueResId);
  66. if(NULL == pWnd)
  67. {
  68. dwRes = ERROR_INVALID_HANDLE;
  69. CALL_FAIL (WINDOW_ERR, TEXT("CWnd::GetDlgItem"), dwRes);
  70. break;
  71. }
  72. pWnd->SetWindowText(messView.GetItemString(pPageInfo[dw].itemType));
  73. //
  74. // Place the caret back at the beginning of the text
  75. //
  76. pWnd->SendMessage (EM_SETSEL, 0, 0);
  77. }
  78. if (ERROR_SUCCESS != dwRes)
  79. {
  80. pParent->SetLastError(ERROR_INVALID_DATA);
  81. pParent->EndDialog(IDABORT);
  82. }
  83. }
  84. BOOL
  85. CMsgPropertyPg::OnSetActive()
  86. {
  87. BOOL bRes = CFaxClientPg::OnSetActive();
  88. GetParent()->PostMessage(WM_SET_SHEET_FOCUS, 0, 0L);
  89. return bRes;
  90. }