// ChildFrm.cpp : implementation of the CChildFrame class // #include "stdafx.h" #include "LYFZIPManage.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 }