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.

147 lines
4.2 KiB

  1. // InvitationDetalisDlg.h : Declaration of the CInvitationDetalisDlg
  2. #ifndef __INVITATIONDETAILSDLG_H_
  3. #define __INVITATIONDETAILSDLG_H_
  4. #include "resource.h" // main symbols
  5. #include <atlhost.h>
  6. #include <atlapp.h>
  7. #include <atlmisc.h>
  8. #include <atlctrls.h>
  9. #include "StaticBold.h"
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CInvitationDetalisDlg
  12. class CInvitationDetailsDlg :
  13. public CAxDialogImpl<CInvitationDetailsDlg>
  14. {
  15. private:
  16. CComBSTR m_bstrTitleSavedTo;
  17. CComBSTR m_bstrSavedTo;
  18. CComBSTR m_bstrExpTime;
  19. CComBSTR m_bstrStatus;
  20. CComBSTR m_bstrIsPwdProtected;
  21. CStaticBold m_Title;
  22. CStaticBold m_CaptionSaveTo;
  23. CStaticBold m_CaptionExpiry;
  24. CStaticBold m_CaptionStatus;
  25. CStaticBold m_CaptionPwdProtected;
  26. CStaticBold m_SaveTo;
  27. CStaticBold m_Expiry;
  28. CStaticBold m_Status;
  29. CStaticBold m_PwdProtected;
  30. public:
  31. CInvitationDetailsDlg(CComBSTR bstrTitleSavedTo, CComBSTR bstrSavedTo, CComBSTR bstrExpTime, CComBSTR bstrStatus, CComBSTR bstrIsPwdProtected)
  32. {
  33. m_bstrTitleSavedTo = bstrTitleSavedTo;
  34. m_bstrSavedTo = bstrSavedTo;
  35. m_bstrExpTime = bstrExpTime;
  36. m_bstrStatus = bstrStatus;
  37. m_bstrIsPwdProtected = bstrIsPwdProtected;
  38. m_SaveTo.m_bBold = FALSE;
  39. m_Expiry.m_bBold = FALSE;
  40. m_Status.m_bBold = FALSE;
  41. m_PwdProtected.m_bBold = FALSE;
  42. m_Title.m_bCaption = TRUE;
  43. m_Title.m_bBold = FALSE;
  44. }
  45. ~CInvitationDetailsDlg()
  46. {
  47. }
  48. enum { IDD = IDD_INVITATIONDETAILSDLG };
  49. BEGIN_MSG_MAP(CInvitationDetailsDlg)
  50. MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  51. // MESSAGE_HANDLER(WM_NCDESTROY,OnNCDestroy)
  52. MESSAGE_HANDLER(WM_CTLCOLORDLG, OnCtlColorDlg)
  53. COMMAND_ID_HANDLER(IDOK, OnOK)
  54. COMMAND_ID_HANDLER(IDCANCEL, OnCancel)
  55. REFLECT_NOTIFICATIONS() // reflect messages back to static ctrls
  56. END_MSG_MAP()
  57. // Handler prototypes:
  58. // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
  59. // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
  60. // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
  61. LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  62. {
  63. USES_CONVERSION;
  64. m_Title.SubclassWindow(GetDlgItem(IDC_TITLE));
  65. m_Title.Invalidate();
  66. m_SaveTo.SubclassWindow(GetDlgItem(IDC_SAVEDTO));
  67. m_Expiry.SubclassWindow(GetDlgItem(IDC_EXPIRY));
  68. m_Status.SubclassWindow(GetDlgItem(IDC_DSTATUS));
  69. m_PwdProtected.SubclassWindow(GetDlgItem(IDC_PWDPROTECTED));
  70. m_SaveTo.SetWindowText(OLE2T(m_bstrSavedTo));
  71. m_SaveTo.Invalidate();
  72. m_Expiry.SetWindowText(OLE2T(m_bstrExpTime));
  73. m_Expiry.Invalidate();
  74. m_Status.SetWindowText(OLE2T(m_bstrStatus));
  75. m_Status.Invalidate();
  76. m_PwdProtected.SetWindowText(OLE2T(m_bstrIsPwdProtected));
  77. m_PwdProtected.Invalidate();
  78. m_CaptionSaveTo.SubclassWindow(GetDlgItem(IDC_CAP_SAVEDTO));
  79. m_CaptionSaveTo.SetWindowText(OLE2T(m_bstrTitleSavedTo));
  80. m_CaptionSaveTo.Invalidate();
  81. m_CaptionExpiry.SubclassWindow(GetDlgItem(IDC_CAP_EXPIRY));
  82. m_CaptionExpiry.Invalidate();
  83. m_CaptionStatus.SubclassWindow(GetDlgItem(IDC_CAP_STATUS));
  84. m_CaptionStatus.Invalidate();
  85. m_CaptionPwdProtected.SubclassWindow(GetDlgItem(IDC_CAP_PWDPROTECTED));
  86. m_CaptionPwdProtected.Invalidate();
  87. CenterWindow(::GetDesktopWindow());
  88. return 1; // Let the system set the focus
  89. }
  90. LRESULT OnCtlColorDlg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  91. {
  92. HBRUSH hNewBrush;
  93. HGDIOBJ hCurrentObject;
  94. hCurrentObject = GetCurrentObject((HDC)wParam,OBJ_BRUSH);
  95. hNewBrush = CreateSolidBrush(GetSysColor(COLOR_WINDOW));
  96. return PtrToInt(hNewBrush);
  97. }
  98. /*
  99. LRESULT OnNCDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  100. {
  101. delete this; //Delete the dialog object
  102. return 0; // If an application processes this message, it should return zero.
  103. }
  104. */
  105. LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  106. {
  107. // DestroyWindow();
  108. EndDialog(wID);
  109. return 0;
  110. }
  111. LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
  112. {
  113. // DestroyWindow();
  114. EndDialog(wID);
  115. return 0;
  116. }
  117. };
  118. #endif //__INVITATIONDETAILSDLG_H_