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.

111 lines
2.4 KiB

  1. /*++
  2. Copyright (C) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. warndlg.cpp
  5. Abstract:
  6. Implementation of the expensive trace data warning dialog.
  7. --*/
  8. #include "stdafx.h"
  9. #include "smlogcfg.h"
  10. #include "smtraceq.h"
  11. #include "provprop.h"
  12. #include "warndlg.h"
  13. #ifdef _DEBUG
  14. #define new DEBUG_NEW
  15. #undef THIS_FILE
  16. static char THIS_FILE[] = __FILE__;
  17. #endif
  18. static ULONG
  19. s_aulHelpIds[] =
  20. {
  21. IDC_CHECK_NO_MORE, IDH_CHECK_NO_MORE,
  22. 0,0
  23. };
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CWarnDlg dialog
  26. CWarnDlg::CWarnDlg(CWnd* pParent /*=NULL*/)
  27. : CDialog(CWarnDlg::IDD, pParent),
  28. m_pProvidersPage ( NULL )
  29. {
  30. //{{AFX_DATA_INIT(CWarnDlg)
  31. m_CheckNoMore = FALSE;
  32. //}}AFX_DATA_INIT
  33. }
  34. void CWarnDlg::DoDataExchange(CDataExchange* pDX)
  35. {
  36. CDialog::DoDataExchange(pDX);
  37. //{{AFX_DATA_MAP(CWarnDlg)
  38. DDX_Check(pDX, IDC_CHECK_NO_MORE, m_CheckNoMore);
  39. //}}AFX_DATA_MAP
  40. }
  41. void
  42. CWarnDlg::SetProvidersPage( CProvidersProperty* pPage )
  43. {
  44. // The providers page is not always the parent, so store a separate pointer
  45. m_pProvidersPage = pPage;
  46. }
  47. BEGIN_MESSAGE_MAP(CWarnDlg, CDialog)
  48. //{{AFX_MSG_MAP(CWarnDlg)
  49. ON_WM_HELPINFO()
  50. ON_WM_CONTEXTMENU()
  51. //}}AFX_MSG_MAP
  52. END_MESSAGE_MAP()
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CWarnDlg message handlers
  55. BOOL
  56. CWarnDlg::OnInitDialog()
  57. {
  58. CSmTraceLogQuery* pQuery;
  59. CString strTitle;
  60. ASSERT ( NULL != m_pProvidersPage );
  61. pQuery = m_pProvidersPage->GetTraceQuery();
  62. if ( NULL != pQuery ) {
  63. pQuery->GetLogName ( strTitle );
  64. SetWindowText ( strTitle );
  65. }
  66. return TRUE; // return TRUE unless you set the focus to a control
  67. // EXCEPTION: OCX Property Pages should return FALSE
  68. }
  69. BOOL
  70. CWarnDlg::OnHelpInfo(HELPINFO* pHelpInfo)
  71. {
  72. ASSERT( NULL != m_pProvidersPage );
  73. if ( pHelpInfo->iCtrlId >= IDC_WARN_FIRST_HELP_CTRL_ID ) {
  74. InvokeWinHelp(WM_HELP, NULL, (LPARAM)pHelpInfo, m_pProvidersPage->GetContextHelpFilePath(), s_aulHelpIds);
  75. }
  76. return TRUE;
  77. }
  78. void
  79. CWarnDlg::OnContextMenu(CWnd* pWnd, CPoint /* point */)
  80. {
  81. ASSERT( NULL != m_pProvidersPage );
  82. InvokeWinHelp(WM_CONTEXTMENU, (WPARAM)(pWnd->m_hWnd), NULL, m_pProvidersPage->GetContextHelpFilePath(), s_aulHelpIds);
  83. return;
  84. }