📄 mainfrm.cpp
字号:
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "MThread.h"
#include "BounceFrm.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
ON_COMMAND(ID_FILE_NEWBOUNCE, OnFileNewbounce)
END_MESSAGE_MAP()
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
// CMainFrame message handlers
void CMainFrame::OnFileNewbounce()
{
// TODO: Add your command handler code here
CBounceFrame *pBounceFrame=new CBounceFrame;
if(!pBounceFrame->Create(_T("Bounce"),WS_CHILD|WS_VISIBLE|WS_OVERLAPPEDWINDOW,rectDefault,this))
return;
}
static BOOL CALLBACK SendPrepareToClose(HWND hWnd,LPARAM)
{
CWnd* pWnd=CWnd::FromHandlePermanent(hWnd);
if(pWnd!=NULL)
{
pWnd->SendMessage(WM_USER_PREPARE_TO_CLOSE);
if(pWnd->GetWindow(GW_CHILD)!=NULL)
::EnumChildWindows(pWnd->m_hWnd,SendPrepareToClose,0);
}
return TRUE;
}
BOOL CMainFrame::DestroyWindow()
{
// TODO: Add your specialized code here and/or call the base class
::EnumChildWindows(m_hWnd,SendPrepareToClose,0);
return CMDIFrameWnd::DestroyWindow();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -