ChildFrm.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // ChildFrm.cpp : implementation of the CChildFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "LYFZIPManage.h"
  5. #include "ChildFrm.h"
  6. #include "MainFrm.H"
  7. #include "MyMdi.H"
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. /////////////////////////////////////////////////////////////////////////////
  14. // CChildFrame
  15. IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
  16. BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
  17. //{{AFX_MSG_MAP(CChildFrame)
  18. ON_WM_CLOSE()
  19. ON_WM_SHOWWINDOW()
  20. //}}AFX_MSG_MAP
  21. END_MESSAGE_MAP()
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CChildFrame construction/destruction
  24. CChildFrame::CChildFrame()
  25. {
  26. // TODO: add member initialization code here
  27. }
  28. CChildFrame::~CChildFrame()
  29. {
  30. }
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CChildFrame diagnostics
  33. #ifdef _DEBUG
  34. void CChildFrame::AssertValid() const
  35. {
  36. CMDIChildWnd::AssertValid();
  37. }
  38. void CChildFrame::Dump(CDumpContext& dc) const
  39. {
  40. CMDIChildWnd::Dump(dc);
  41. }
  42. #endif //_DEBUG
  43. /////////////////////////////////////////////////////////////////////////////
  44. // CChildFrame message handlers
  45. void CChildFrame::ActivateFrame(int nCmdShow)
  46. {
  47. // TODO: Add your specialized code here and/or call the base class
  48. CString strName;
  49. CMyMdi mdi;
  50. CMDIChildWnd::ActivateFrame(nCmdShow);
  51. //strName = ((CMainFrame*)AfxGetMainWnd())->m_Mdi.GetName(this);
  52. strName = mdi.GetName((CWnd*)this);
  53. SetWindowText(strName);
  54. }
  55. void CChildFrame::OnClose()
  56. {
  57. // TODO: Add your message handler code here and/or call default
  58. CMyMdi mdi;
  59. if(mdi.ChildClose((CWnd*)this))
  60. {
  61. CMDIChildWnd::OnClose();
  62. }
  63. }
  64. void CChildFrame::OnShowWindow(BOOL bShow, UINT nStatus)
  65. {
  66. CMyMdi mdi;
  67. if(bShow && mdi.GetCount() == 1)
  68. ShowWindow(SW_MAXIMIZE);
  69. else
  70. CMDIChildWnd::OnShowWindow(bShow, nStatus);
  71. // TODO: Add your message handler code here
  72. }