MyMdi.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // MyMid.h: interface for the CMyMid class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_MYMID_H__475A2490_56CA_4E11_9D8F_F0DA55816154__INCLUDED_)
  5. #define AFX_MYMID_H__475A2490_56CA_4E11_9D8F_F0DA55816154__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "ChildFrm.h"
  10. //登记MDI窗口的打开和关闭
  11. class CMyMdi
  12. {
  13. protected:
  14. public:
  15. void CloseAll();
  16. void DeleteAll(void);
  17. struct tabMyMdi
  18. {
  19. char szName[65];
  20. CWnd *pView;
  21. CWnd *pSubView;
  22. tabMyMdi *pNext;
  23. };
  24. //m_pMyMdi必需以tabMyMdi*指针类型使用
  25. //设置为void*类型,因为tabMyMdi为内部类型
  26. //不能以静态方式初始化m_pMyMdi指针
  27. static void *m_pMyMdi;
  28. static BOOL m_bExitCode;
  29. void SetExitCode(BOOL bCode){m_bExitCode=bCode;}
  30. static BOOL GetExitCode(void){return m_bExitCode;}
  31. BOOL MainClose(BOOL bMsg = true);
  32. BOOL ChildClose(CWnd *pView);
  33. int Append(char *pName, CRuntimeClass* pNewViewClass,
  34. UINT nIcon=0,CWnd* pParentWnd = NULL,
  35. UINT nID = 0); //打开
  36. BOOL Delete(char *pName); //删除
  37. BOOL Delete(CWnd *pView); //删除
  38. BOOL SetSubView(CWnd *pView, CWnd *pDlg);
  39. CWnd *GetSubView(CWnd *pView);//取子窗口指针
  40. char *GetName(CWnd *pView); //取窗口名称
  41. CWnd *GetView(char *pName); //取窗口名称
  42. int GetIndex(char *pName); //取窗口索引
  43. int GetCount();
  44. CMyMdi();
  45. virtual ~CMyMdi();
  46. };
  47. #endif // !defined(AFX_MYMID_H__475A2490_56CA_4E11_9D8F_F0DA55816154__INCLUDED_)