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.

123 lines
2.9 KiB

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "ncbrowse.h"
  5. #include "MainFrm.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CMainFrame
  13. IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
  14. BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
  15. //{{AFX_MSG_MAP(CMainFrame)
  16. // NOTE - the ClassWizard will add and remove mapping macros here.
  17. // DO NOT EDIT what you see in these blocks of generated code !
  18. ON_WM_CREATE()
  19. //}}AFX_MSG_MAP
  20. // Global help commands
  21. ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
  22. ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
  23. ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
  24. ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
  25. END_MESSAGE_MAP()
  26. static UINT indicators[] =
  27. {
  28. ID_SEPARATOR, // status line indicator
  29. ID_INDICATOR_CAPS,
  30. ID_INDICATOR_NUM,
  31. ID_INDICATOR_SCRL,
  32. };
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CMainFrame construction/destruction
  35. CMainFrame::CMainFrame()
  36. {
  37. // TODO: add member initialization code here
  38. }
  39. CMainFrame::~CMainFrame()
  40. {
  41. }
  42. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  43. {
  44. if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  45. return -1;
  46. if (!m_wndToolBar.CreateEx(this) ||
  47. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  48. {
  49. TRACE0("Failed to create toolbar\n");
  50. return -1; // fail to create
  51. }
  52. if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
  53. CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
  54. {
  55. TRACE0("Failed to create dialogbar\n");
  56. return -1; // fail to create
  57. }
  58. if (!m_wndReBar.Create(this) ||
  59. !m_wndReBar.AddBar(&m_wndToolBar) ||
  60. !m_wndReBar.AddBar(&m_wndDlgBar))
  61. {
  62. TRACE0("Failed to create rebar\n");
  63. return -1; // fail to create
  64. }
  65. if (!m_wndStatusBar.Create(this) ||
  66. !m_wndStatusBar.SetIndicators(indicators,
  67. sizeof(indicators)/sizeof(UINT)))
  68. {
  69. TRACE0("Failed to create status bar\n");
  70. return -1; // fail to create
  71. }
  72. // TODO: Remove this if you don't want tool tips
  73. m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
  74. CBRS_TOOLTIPS | CBRS_FLYBY);
  75. return 0;
  76. }
  77. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  78. {
  79. if( !CMDIFrameWnd::PreCreateWindow(cs) )
  80. return FALSE;
  81. // TODO: Modify the Window class or styles here by modifying
  82. // the CREATESTRUCT cs
  83. return TRUE;
  84. }
  85. /////////////////////////////////////////////////////////////////////////////
  86. // CMainFrame diagnostics
  87. #ifdef _DEBUG
  88. void CMainFrame::AssertValid() const
  89. {
  90. CMDIFrameWnd::AssertValid();
  91. }
  92. void CMainFrame::Dump(CDumpContext& dc) const
  93. {
  94. CMDIFrameWnd::Dump(dc);
  95. }
  96. #endif //_DEBUG
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CMainFrame message handlers