📄 childfrm.cpp
字号:
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "MDIDemo.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
ON_WM_CLOSE()
ON_WM_SIZE()
ON_WM_SETFOCUS()
ON_WM_KILLFOCUS()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
issetfocus=0;
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
void CChildFrame::OnClose()
{
// TODO: Add your message handler code here and/or call default
//this->get
if(istabclose)
{
//AfxMessageBox("");
CMDIChildWnd::OnClose();
}
}
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
//AfxMessageBox("");
//CString str;
//str.Format("nType=%d",nType);//破解出的消息得,最大化为2,最小化为1,恢复为0
//AfxMessageBox(str);
//if(nType==2)//过滤最小化和恢复
//{
// return;
//}
CMDIChildWnd::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
}
void CChildFrame::OnSetFocus(CWnd* pOldWnd)
{
CMDIChildWnd::OnSetFocus(pOldWnd);
TCITEM ptcitem;
memset(&ptcitem,0,sizeof(TCITEM));
if(issetfocus==0)
{
issetfocus=1;
for(int i=0;i<255;i++)
{
ptcitem.mask=TCIF_PARAM;
ptab.GetItem(i,&ptcitem);
if(this==ptab.pmyWnd[ptcitem.lParam])
{
break;
}
}
ptab.SetCurSel(i);
//AfxMessageBox("OnSetFocus");
}
// TODO: Add your message handler code here
}
void CChildFrame::OnKillFocus(CWnd* pNewWnd)
{
CMDIChildWnd::OnKillFocus(pNewWnd);
issetfocus=0;
// TODO: Add your message handler code here
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -