home *** CD-ROM | disk | FTP | other *** search
/ Master Visual C++ 1.5 / MASTERVC15.ISO / vcprog / original / ch20 / grow / mainfrm.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-26  |  1.9 KB  |  86 lines

  1. // mainfrm.cpp : implementation of the CMainFrame class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "grow.h"
  6.  
  7. #include "mainfrm.h"
  8.  
  9. #ifdef _DEBUG
  10. #undef THIS_FILE
  11. static char BASED_CODE THIS_FILE[] = __FILE__;
  12. #endif
  13.  
  14. /////////////////////////////////////////////////////////////////////////////
  15. // CMainFrame
  16.  
  17. IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
  18.  
  19. BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
  20.     //{{AFX_MSG_MAP(CMainFrame)
  21.     ON_WM_CREATE()
  22.     //}}AFX_MSG_MAP
  23. END_MESSAGE_MAP()
  24.  
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CMainFrame construction/destruction
  27.  
  28. CMainFrame::CMainFrame()
  29. {
  30.     // TODO: add member initialization code here
  31. }
  32.  
  33. CMainFrame::~CMainFrame()
  34. {
  35. }
  36.  
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CMainFrame diagnostics
  39.  
  40. #ifdef _DEBUG
  41. void CMainFrame::AssertValid() const
  42. {
  43.     CFrameWnd::AssertValid();
  44. }
  45.  
  46. void CMainFrame::Dump(CDumpContext& dc) const
  47. {
  48.     CFrameWnd::Dump(dc);
  49. }
  50.  
  51. #endif //_DEBUG
  52.  
  53. /////////////////////////////////////////////////////////////////////////////
  54. // CMainFrame message handlers
  55.  
  56. int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
  57. {
  58.     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
  59.         return -1;
  60.     
  61.     // TODO: Add your specialized creation code here
  62.  
  63.      //////////////////////
  64.      // MY CODE STARTS HERE
  65.      //////////////////////
  66.  
  67.      // Extract the pointer of the menu
  68.      CMenu* pMenu = GetMenu();
  69.  
  70.      // Extract the pointer of the Growing menu
  71.      CMenu* pGrowingMenu = pMenu->GetSubMenu(1);
  72.  
  73.      // Delete the current items in the Growing menu
  74.      pGrowingMenu->DeleteMenu(5, MF_BYPOSITION);
  75.      pGrowingMenu->DeleteMenu(4, MF_BYPOSITION);
  76.      pGrowingMenu->DeleteMenu(3, MF_BYPOSITION);
  77.      pGrowingMenu->DeleteMenu(2, MF_BYPOSITION);
  78.      pGrowingMenu->DeleteMenu(1, MF_BYPOSITION);
  79.  
  80.      ////////////////////
  81.      // MY CODE ENDS HERE
  82.      ////////////////////
  83.     
  84.     return 0;
  85. }
  86.