ChildFrm.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // ChildFrm.cpp : implementation of the CChildFrame class
  2. //
  3. #include "stdafx.h"
  4. #include "Demo.h"
  5. #include "ChildFrm.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // CChildFrame
  13. IMPLEMENT_DYNCREATE(CChildFrame, CResizableMDIChild)
  14. BEGIN_MESSAGE_MAP(CChildFrame, CResizableMDIChild)
  15. //{{AFX_MSG_MAP(CChildFrame)
  16. //}}AFX_MSG_MAP
  17. END_MESSAGE_MAP()
  18. /////////////////////////////////////////////////////////////////////////////
  19. // CChildFrame construction/destruction
  20. CChildFrame::CChildFrame()
  21. {
  22. }
  23. CChildFrame::~CChildFrame()
  24. {
  25. }
  26. BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
  27. {
  28. if( !CResizableMDIChild::PreCreateWindow(cs) )
  29. return FALSE;
  30. return TRUE;
  31. }
  32. /////////////////////////////////////////////////////////////////////////////
  33. // CChildFrame diagnostics
  34. #ifdef _DEBUG
  35. void CChildFrame::AssertValid() const
  36. {
  37. CResizableMDIChild::AssertValid();
  38. }
  39. void CChildFrame::Dump(CDumpContext& dc) const
  40. {
  41. CResizableMDIChild::Dump(dc);
  42. }
  43. #endif //_DEBUG
  44. /////////////////////////////////////////////////////////////////////////////
  45. // CChildFrame message handlers
  46. void CChildFrame::ActivateFrame(int nCmdShow)
  47. {
  48. if ( EnableSaveRestore(_T("Demo MDI Frame")) )
  49. {
  50. // if correctly restored, activate window and return
  51. MDIActivate();
  52. return;
  53. }
  54. CResizableMDIChild::ActivateFrame(nCmdShow);
  55. }