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.

125 lines
3.7 KiB

  1. //////////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 2002 Microsoft Corporation. All rights reserved.
  3. // Copyright (c) 2002 OSR Open Systems Resources, Inc.
  4. //
  5. // LogSessionAdvPropSht.cpp : implementation of the CLogSession class
  6. //////////////////////////////////////////////////////////////////////////////
  7. #include "stdafx.h"
  8. #include "resource.h"
  9. #include <tchar.h>
  10. #include <wmistr.h>
  11. #include <initguid.h>
  12. extern "C" {
  13. #include <evntrace.h>
  14. }
  15. #include <traceprt.h>
  16. #include "traceview.h"
  17. #include "logsession.h"
  18. #include "DisplayDlg.h"
  19. #include "logDisplayOptionDlg.h"
  20. #include "LogSessionOutputOptionDlg.h"
  21. #include "LogSessionInformationDlg.h"
  22. #include "ProviderSetupDlg.h"
  23. #include "LogSessionPropSht.h"
  24. #include "LogSessionAdvPropSht.h"
  25. IMPLEMENT_DYNAMIC(CLogSessionAdvPropSht, CPropertySheet)
  26. BEGIN_MESSAGE_MAP(CLogSessionAdvPropSht, CPropertySheet)
  27. //{{AFX_MSG_MAP(CLogSessionAdvPropSht)
  28. ON_BN_CLICKED(IDOK, OnBnClickedOk)
  29. ON_BN_CLICKED(IDCANCEL, OnBnClickedCancel)
  30. ON_BN_CLICKED(ID_WIZFINISH, OnBnClickedOk)
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. CLogSessionAdvPropSht::CLogSessionAdvPropSht(CWnd* pWndParent, CLogSessionPropSht *pLogSessionPropSht)
  34. : CPropertySheet(IDS_LOG_SESSION_OPTIONS_TITLE, pWndParent),
  35. m_displayOptionPage(pLogSessionPropSht)
  36. {
  37. AddPage(&m_logSessionOutputOptionDlg);
  38. m_pLogSessionPropSht = pLogSessionPropSht;
  39. if(m_pLogSessionPropSht->IsWizard()) {
  40. AddPage(&m_displayOptionPage);
  41. }
  42. m_pLogSession = pLogSessionPropSht->m_pLogSession;
  43. }
  44. BOOL CLogSessionAdvPropSht::OnInitDialog()
  45. {
  46. CString str;
  47. BOOL bResult = CPropertySheet::OnInitDialog();
  48. //
  49. // add the window to the property sheet.
  50. //
  51. CRect rectWnd;
  52. GetWindowRect(rectWnd);
  53. SetWindowPos(NULL, 0, 0,
  54. rectWnd.Width(),
  55. rectWnd.Height(),
  56. SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
  57. CenterWindow();
  58. //
  59. // Make sure both pages get displayed at
  60. // least once, so values are updated. Otherwise,
  61. // improper data will get copied back to the
  62. // CLogSessionPropSht instance.
  63. //
  64. if(m_pLogSessionPropSht->IsWizard()) {
  65. SetActivePage(&m_displayOptionPage);
  66. }
  67. SetActivePage(&m_logSessionOutputOptionDlg);
  68. return bResult;
  69. }
  70. void CLogSessionAdvPropSht::OnBnClickedOk()
  71. {
  72. CString str;
  73. CListCtrl *pList;
  74. //
  75. // Propagate settings back to the CLogSessionPropSht instance. We
  76. // wait until here to do this to ensure that any changes made do
  77. // not effect the data that ends up in the log session settings if
  78. // a cancel is hit along the way.
  79. //
  80. //
  81. // update the file select checks
  82. //
  83. m_pLogSessionPropSht->m_bWriteListingFile = ((CButton *)m_logSessionOutputOptionDlg.GetDlgItem(IDC_LISTING_FILE_CHECK))->GetCheck();
  84. m_pLogSessionPropSht->m_bWriteSummaryFile = ((CButton *)m_logSessionOutputOptionDlg.GetDlgItem(IDC_SUMMARY_FILE_CHECK))->GetCheck();
  85. //
  86. // update the file names
  87. //
  88. m_logSessionOutputOptionDlg.m_listingFileName.GetWindowText(m_pLogSessionPropSht->m_listingFileName);
  89. m_logSessionOutputOptionDlg.m_summaryFileName.GetWindowText(m_pLogSessionPropSht->m_summaryFileName);
  90. if(m_pLogSessionPropSht->IsWizard()) {
  91. //
  92. // update the log session parameter values skipping state
  93. //
  94. for(LONG ii = 1; ii < MaxLogSessionOptions; ii++) {
  95. m_pLogSessionPropSht->m_logSessionValues[ii] =
  96. m_displayOptionPage.m_displayOptionList.GetItemText(ii, 1);
  97. }
  98. }
  99. EndDialog(1);
  100. }
  101. void CLogSessionAdvPropSht::OnBnClickedCancel()
  102. {
  103. EndDialog(2);
  104. }