MainControl.cpp
资源名称:(vc).rar [点击查看]
上传用户:wpp2016
上传日期:2010-02-01
资源大小:1250k
文件大小:2k
源码类别:
Telnet服务器
开发平台:
Visual C++
- // MainControl.cpp : implementation file
- //
- #include "stdafx.h"
- #include "anywhere.h"
- #include "MainControl.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CMainControl
- IMPLEMENT_DYNCREATE(CMainControl, CView)
- CMainControl::CMainControl()
- {
- }
- CMainControl::~CMainControl()
- {
- }
- BEGIN_MESSAGE_MAP(CMainControl, CView)
- //{{AFX_MSG_MAP(CMainControl)
- ON_WM_CREATE()
- ON_WM_SIZE()
- ON_NOTIFY(TVN_SELCHANGED,IDC_MENUCTRL,OnSelchangedTree)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CMainControl drawing
- void CMainControl::OnDraw(CDC* pDC)
- {
- CDocument* pDoc = GetDocument();
- // TODO: add draw code here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CMainControl diagnostics
- #ifdef _DEBUG
- void CMainControl::AssertValid() const
- {
- CView::AssertValid();
- }
- void CMainControl::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CMainControl message handlers
- int CMainControl::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate(lpCreateStruct) == -1)
- return -1;
- CRect rect;
- m_treectrl.Create(WS_CHILD,rect,this,IDC_MENUCTRL);
- m_treectrl.ShowWindow(SW_SHOW);
- m_edit.Create(WS_CHILD|WS_VISIBLE|WS_DLGFRAME|WS_EX_CLIENTEDGE
- |WS_VSCROLL|ES_MULTILINE,rect,this,IDC_DATIL);
- m_edit.ShowWindow(SW_SHOW);
- /*
- m_edit.Create(WS_CHILD|WS_VSCROLL|ES_MULTILINE,rect,this,IDC_FLATEDIT);
- //m_edit.m_clrShadow=RGB(255,255,255);
- //m_edit.m_bLBtnDown=TRUE;
- //m_edit.m_bFlatStyle=FALSE;
- m_edit.ShowWindow(SW_SHOW);
- */
- //会调用onsize;
- return 0;
- }
- void CMainControl::OnSize(UINT nType, int cx, int cy)
- {
- CView::OnSize(nType, cx, cy);
- if (m_treectrl.GetSafeHwnd())
- m_treectrl.MoveWindow(0,0,cx/2,cy,TRUE);
- if (m_edit.GetSafeHwnd())
- m_edit.MoveWindow(cx/2,cy/6,cx/3,cy*2/3,TRUE);
- }
- void CMainControl::OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult)
- {
- *pResult = 0;
- }