home *** CD-ROM | disk | FTP | other *** search
- // mainfrm.cpp : implementation of the CMainFrame class
- //
-
- #include "stdafx.h"
- #include "picmenu.h"
-
- #include "mainfrm.h"
-
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
-
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
-
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
-
- CMainFrame::CMainFrame()
- {
- // TODO: add member initialization code here
- }
-
- CMainFrame::~CMainFrame()
- {
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
-
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
-
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
-
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
-
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- //////////////////////
- // MY CODE STARTS HERE
- //////////////////////
-
- // Extract the pointer of the menu
- CMenu* pMenu = GetMenu();
-
- // Extract the pointer of the Picture Menu menu
- CMenu* pPictureMenu = pMenu->GetSubMenu(1);
-
- // Delete the current items in the Picture Menu menu
- pPictureMenu->DeleteMenu(4, MF_BYPOSITION);
- pPictureMenu->DeleteMenu(3, MF_BYPOSITION);
- //pPictureMenu->DeleteMenu(2, MF_BYPOSITION);
- //pPictureMenu->DeleteMenu(1, MF_BYPOSITION);
- //pPictureMenu->DeleteMenu(0, MF_BYPOSITION);
-
-
- // Create the object of the bitmap.
- CBitmap* pBit;
-
-
- // Load the bitmap
- pBit->LoadBitmap(IDB_BITMAP1);
-
-
- // Append a separator item to the Picture Menu menu
- pPictureMenu->AppendMenu ( MF_SEPARATOR,
- ID_PICTUREMENU_ITEM4 );
-
- // Append a bitmap item to the Picture Menu menu
- pPictureMenu->AppendMenu ( MF_ENABLED,
- ID_PICTUREMENU_ITEM1,
- pBit);
-
- ////////////////////
- // MY CODE ENDS HERE
- ////////////////////
-
-
- // TODO: Add your specialized creation code here
-
- return 0;
- }
-