Source code of Windows XP (NT5)
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.

115 lines
2.5 KiB

  1. // MainFrm.cpp : implementation of the CMainFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "OUPicker.h"
  5. #include "MainFrm.h"
  6. #include "ContainerSelectionDlg.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CMainFrame
  14. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  15. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  16. //{{AFX_MSG_MAP(CMainFrame)
  17. ON_WM_CREATE()
  18. ON_COMMAND(ID_FILE_NEW, OnFileNew)
  19. //}}AFX_MSG_MAP
  20. END_MESSAGE_MAP()
  21. static UINT indicators[] =
  22. {
  23. ID_SEPARATOR, // status line indicator
  24. ID_INDICATOR_CAPS,
  25. ID_INDICATOR_NUM,
  26. ID_INDICATOR_SCRL,
  27. };
  28. /////////////////////////////////////////////////////////////////////////////
  29. // CMainFrame construction/destruction
  30. CMainFrame::CMainFrame()
  31. {
  32. // TODO: add member initialization code here
  33. }
  34. CMainFrame::~CMainFrame()
  35. {
  36. }
  37. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  38. {
  39. if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  40. return -1;
  41. if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
  42. | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
  43. !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
  44. {
  45. TRACE0("Failed to create toolbar\n");
  46. return -1; // fail to create
  47. }
  48. if (!m_wndStatusBar.Create(this) ||
  49. !m_wndStatusBar.SetIndicators(indicators,
  50. sizeof(indicators)/sizeof(UINT)))
  51. {
  52. TRACE0("Failed to create status bar\n");
  53. return -1; // fail to create
  54. }
  55. // TODO: Delete these three lines if you don't want the toolbar to
  56. // be dockable
  57. m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
  58. EnableDocking(CBRS_ALIGN_ANY);
  59. DockControlBar(&m_wndToolBar);
  60. return 0;
  61. }
  62. BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
  63. {
  64. if( !CFrameWnd::PreCreateWindow(cs) )
  65. return FALSE;
  66. // TODO: Modify the Window class or styles here by modifying
  67. // the CREATESTRUCT cs
  68. return TRUE;
  69. }
  70. /////////////////////////////////////////////////////////////////////////////
  71. // CMainFrame diagnostics
  72. #ifdef _DEBUG
  73. void CMainFrame::AssertValid() const
  74. {
  75. CFrameWnd::AssertValid();
  76. }
  77. void CMainFrame::Dump(CDumpContext& dc) const
  78. {
  79. CFrameWnd::Dump(dc);
  80. }
  81. #endif //_DEBUG
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CMainFrame message handlers
  84. void CMainFrame::OnFileNew()
  85. {
  86. CContainerSelectionDlg dlg;
  87. dlg.m_strDomain = CString("devraptorw2k");
  88. dlg.m_strCont = CString("OU=THANKS,OU=MAWLA,OU=TRIAL,OU=HELLO");
  89. }