NMDIClient.cpp
上传用户:libwxy
上传日期:2007-01-02
资源大小:200k
文件大小:2k
源码类别:

工具条

开发平台:

Visual C++

  1. // NMDIClient.cpp : implementation file
  2. //
  3. /*
  4. Copyright (C) 1998 Tony Hoyle (tmh@netfusion.co.uk)
  5. This program is free software; you can redistribute it and/or modify it under the terms
  6. of the GNU General Public License as published by the Free Software Foundation; either
  7. version 2 of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  9. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License along with this program;
  12. if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  13. */
  14. #include "stdafx.h"
  15. #include "NMDIClient.h"
  16. #include "NGenericMenu.h"
  17. #include "NMDIMenuFrameWnd.h"
  18. #ifdef _DEBUG
  19. #define new DEBUG_NEW
  20. #undef THIS_FILE
  21. static char THIS_FILE[] = __FILE__;
  22. #endif
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CNMDIClient
  25. CNMDIClient::CNMDIClient(CNGenericMenu* pMenu)
  26. {
  27. m_pMenu=pMenu;
  28. }
  29. CNMDIClient::~CNMDIClient()
  30. {
  31. }
  32. BEGIN_MESSAGE_MAP(CNMDIClient, CWnd)
  33. //{{AFX_MSG_MAP(CNMDIClient)
  34. //}}AFX_MSG_MAP
  35. ON_MESSAGE(WM_MDISETMENU,OnSetMenu)
  36. END_MESSAGE_MAP()
  37. /////////////////////////////////////////////////////////////////////////////
  38. // CNMDIClient message handlers
  39. LRESULT CNMDIClient::OnSetMenu(WPARAM wParam, LPARAM lParam)
  40. {
  41. if(wParam) m_pMenu->SetMenu((HMENU)wParam);
  42. else m_pMenu->SetMenu(((CNMDIMenuFrameWnd*)GetParentFrame())->m_hDefaultMenu);
  43. return DefWindowProc(WM_MDISETMENU,NULL,lParam);
  44. }