12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- // ChildFrm.cpp : implementation of the CChildFrame class
- //
- #include "stdafx.h"
- #include "LYFZSendMsg.h"
- #include "ChildFrm.h"
- #include "MainFrm.H"
- #include "MyMdi.H"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame
- IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
- BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
- //{{AFX_MSG_MAP(CChildFrame)
- ON_WM_CLOSE()
- ON_WM_SHOWWINDOW()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame construction/destruction
- CChildFrame::CChildFrame()
- {
- // TODO: add member initialization code here
-
- }
- CChildFrame::~CChildFrame()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame diagnostics
- #ifdef _DEBUG
- void CChildFrame::AssertValid() const
- {
- CMDIChildWnd::AssertValid();
- }
- void CChildFrame::Dump(CDumpContext& dc) const
- {
- CMDIChildWnd::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CChildFrame message handlers
- void CChildFrame::ActivateFrame(int nCmdShow)
- {
- // TODO: Add your specialized code here and/or call the base class
- CString strName;
- CMyMdi mdi;
- CMDIChildWnd::ActivateFrame(nCmdShow);
- //strName = ((CMainFrame*)AfxGetMainWnd())->m_Mdi.GetName(this);
- strName = mdi.GetName((CWnd*)this);
- SetWindowText(strName);
- }
- void CChildFrame::OnClose()
- {
- // TODO: Add your message handler code here and/or call default
- CMyMdi mdi;
- if(mdi.ChildClose((CWnd*)this))
- {
- CMDIChildWnd::OnClose();
- }
- }
- void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus)
- {
- CMyMdi mdi;
- if(bShow && mdi.GetCount() == 1)
- ShowWindow(SW_MAXIMIZE);
- else
- CMDIChildWnd::OnShowWindow(bShow, nStatus);
- // TODO: Add your message handler code here
- }
|